[fpc-pascal] assigning ansistring with shortstring

Jonas Maebe jonas.maebe at elis.ugent.be
Sun May 28 15:29:00 CEST 2006

On 27 May 2006, at 21:54, L505 wrote:

>> Note that the setlength will generate exactly the same code as the
>> 'last3[0]:=chr(3);' statement, so it's better to keep the setlength
>> (in case the string would ever become an ansistring, or just for
>> readability)
> I didn't think the compiler would let you access string[0] directly  
> anyway, even with
> range checking off - since that's a compiler thing - but I haven't  
> checked for sure.

It does allow it for shortstrings, just like TP did.


More information about the fpc-pascal mailing list