Jonas Maebe wrote:
Is that not also undocumented behaviour ?
I'm quite sure it isn't: afaik typecasting an ansistring to a pchar is
fully supported. This means that an empty ansistring must result in an
empty (as opposed to an invalid) pchar.
Taken from Delphi 7 help:
Mixing Delphi strings and null-terminated strings
* You can also use Pointer(S) to cast a long string to an untyped
pointer. But if S is empty, the typecast returns nil.
* PChar(S) always returns a pointer to a memory block; if S is empty, a
pointer to #0 is returned.
Regards,
- Graeme -
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel