[fpc-pascal] Is there a StringRefCount() equivalence?

Anton Tichawa anton.tichawa at chello.at
Thu Apr 29 19:44:08 CEST 2010


On Thu, 2010-04-29 at 10:30 -0700, Bihar Anwar wrote:
> Delphi has StringRefCount() function (I'm not aware since what version it was introduced). I just curious, is there a function equivalent to it in FPC? Currently, I just steal a portion of code from System unit:
> 
> type
>   PAnsiRec = ^TAnsiRec;
>   TAnsiRec = packed record
>     Ref,
>     Len   : SizeInt;
>     First : Char;
>   end;
> 
> const
>   FirstOff   = SizeOf(TAnsiRec) - 1;

shouldn't that read e.g.


> const
>   FirstOff   = SizeOf(TAnsiRec) - SizeOf(Char);
> 

SCNR

Anton





More information about the fpc-pascal mailing list