[fpc-pascal] more questions on storage

Marc Santhoff M.Santhoff at t-online.de
Wed Sep 26 15:12:03 CEST 2007


Am Mittwoch, den 26.09.2007, 13:24 +0200 schrieb Marco van de Voort:
> > > On 26 Sep 2007, at 11:56, Marc Santhoff wrote:
> > > ansistring rather than for shortstring. Separately from that there is  
> > > also a type called "longstring" which is basically a shortstring but  
> > > with a 4 byte length field. It's this longstring which has not been  
> > > implemented properly.
> > > 
> > > Ansistrings (and thus {$longstrings on}) work fine.
> > 
> > Ah, okay. The Fog is lifting fastly. :)
> > 
> > And AnsiStrings are pretty much compatible to C's char*. Very handy.
> 
> Yes, though ansistrings may contain #0's.

Interesting, how will a cast handle this case?

Will it change the intermediate #0 to something else or will the
resulting pchars be cut at first occurrence?

I'd never use #0 in the middle of a string myself, but to be sure if a
user manages to do so ...

Marc





More information about the fpc-pascal mailing list