Copy out of range

Checks if a comparison using a copy statement is valid. For example:

  If Copy(s,1,3)=’test’ then //will always return false

It should read:

  If Copy(s,1,4)=’test’ then //might now return true

Another warning is if the second parameter is zero instead of 1. For example:

  t:=Copy(s,0,3); //0 is out of range, should probably be 1

 




< Back to list of hints and warnings