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

Bihar Anwar bihar_anwar at rocketmail.com
Fri Apr 30 05:42:11 CEST 2010


Thanks Anton for your suggestion, I will apply it. I hope FPC developers will include StringRefCount() to the RTL.

By the way, how do I call internal compiler functions directly (maybe using a tricky way) such as  system.fpc_ansistr_incr_ref()  and  system.fpc_ansistr_decr_ref?
I couldn't call those kind of functions from my program, I guest it is caused by compilerproc  definition.



----- Original Message ----
From: Anton Tichawa <anton.tichawa at chello.at>
To: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
Sent: Fri, April 30, 2010 12:44:08 AM
Subject: Re: [fpc-pascal] Is there a StringRefCount() equivalence?

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


_______________________________________________
fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



      



More information about the fpc-pascal mailing list