[fpc-pascal] Procedure types

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Sat Dec 20 10:13:10 CET 2008


leledumbo wrote:
> FPC treats procedural types "a little" different from Delphi / TP, see 
> http://www.freepascal.org/docs-html/ref/refse17.html this . You can
> therefore write your AddressOf function as:
> FUNCTION AddressOf(VAR x): POINTER; 
> ... // variables (if you ever need)
> begin
> {$ifdef fpc}
> AddressOf:=@x;
> {$else}
> ... // for other compilers
> {$endif}
> end;

That's exactly what I'm doing at the moment- plus a whole lot of extra 
complexity due to having to accommodate two different directive formats.

The problem isn't defining the AddressOf() function, it's applying it to 
a procedure variable as shown in my original message.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list