[fpc-pascal] Is it save to think default value of untouched string is ''?

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Mar 6 21:54:10 CET 2010


On 06 Mar 2010, at 22:03, Juha Manninen wrote:

>> If you want Delphi-compatible behaviour, you must add {$mode delphi} at the
>> top of your program. In the default mode, "string" is an alias for
>> shortstring instead of ansistring ({$h-} mode).
> 
> And even then you should initialize strings. They are not quaranteed to be 
> empty.

Reference-counted types sort of are guaranteed to be initialised on function entry (because otherwise the whole reference counting thing would fail 99% of the time).


Jonas


More information about the fpc-pascal mailing list