[fpc-pascal] Empty string

Gene Buckle geneb at deltasoft.com
Thu Mar 6 19:34:41 CET 2008

> I thought string should be accessed from 1 not 0 for compatibility.
> And it is what I am doing.
> for i := 1 to length(s) do ...
> so I am not sure that using s[0] is safe

If memory serves, the [0] element was originally used to hold a byte that 
was equivalent to the string length.  This was in the Turbo Pascal days 
though.  I don't recall if that behavior was carried over into Delphi or 
the Delphi mode of FPC.


-- Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.

More information about the fpc-pascal mailing list