Graeme Geldenhuys wrote:
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.

Thanks, that is very ugly. That means that PChar(Pointer(MyStr)) is not the same as PChar(MyStr) which is not very pascalish IMHO, but ok.

I can understand that PChar(MyStr) to always return a valid pointer is a desirable property of course, but why not use a function instead that does this ? Useless question, of course.

Micha

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to