[fpc-pascal] AnsiString

Jürgen Hestermann juergen.hestermann at gmx.de
Wed Jan 26 07:50:01 CET 2011


Luis Fernando Del Aguila Mejía schrieb:
 >  p:=pointer(cad1);
 >  p:=p-8;
 >  Write('memory address : ',longint(p),'=');   //Must show Size, but 
shows reference count
 >  Writeln(longint(p^));

I fail to see why you need to mess with the internals of ansistrings at all.
What is the reason to access size and reference count this way?
At least for the size there is Length(cad1) which would be much clearer.

Although pointer arithmetic is possible in Pascal it looks like C.
And you loose any help from the compiler to check types.




More information about the fpc-pascal mailing list