[fpc-devel] Copy function and dynamic array

kyan alfasud.ti at gmail.com
Wed Feb 29 14:37:23 CET 2012


> In the mean time there is tons of code that relies on copy() copying until
> end of string or dynamic array. Constructions like
> param=copy(s,pos('=')+1,length(s)) are plenty. Just do a grep in the fpc
> compiler dir for "copy(" and you'l find plenty of copy(s,p+1,255) and the
> like.

Second that, In lack of a explicit "copy-to-end" RTL function I have
always used Copy(S, <SomePos>, MaxInt) in Delphi to copy to the end of
a string. I find it easier to write, more self-explanatory and perhaps
faster to execute (minus a string length fetching and a subtraction)
than writing Length(S) - <SomePos>, especially if <SomePos> is an
expression.



More information about the fpc-devel mailing list