On Sun, 08 Jul 2018 18:28:34 +0200, Bo Berglund
<bo.bergl...@gmail.com> wrote:

>I tried this:
>var
>  offs: word;
>begin
>  ...
>  offs := @FAppData.Info - @FAppData; //Info is 4th member of record
>  address := AppBase + (AppNumber -1) * (SizeOf(TAppData) div 2) +
>offs;
>
>But it was not accepted by the compiler (on the offs := line)...
>Error: Operator not applicable to this operand type

But typecasting the operation fixed the problem:

  offs := Cardinal(@FAppData.Info) - Cardinal(@FAppData);

No compiler errors here anymore.

-- 
Bo Berglund
Developer in Sweden

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to