[fpc-pascal]How to call a variable of a procedural type?

Pedro Lopez-Cabanillas plcl at telefonica.net
Sat Oct 26 13:57:38 CEST 2002


Hi,

There are two different syntax available:

{$mode FPC}
begin
  fun:=@myfunction;
  a:=fun(); //@1
  writeln(fun); //@2
end.

{$mode TP}
begin
  fun:=myfunction;
  a:=fun; //@1
  writeln(fun); //@2
end.

You can see that the assignement instruction is different in FPC (native mode) 
and TP compatibility mode. In @1 there is another difference, because some 
ambiguity that is not at @2.

Online docs explainig this: 
http://www.freepascal.org/docs-html/prog/node18.html#SECTION001810000000000000000
http://www.freepascal.org/docs-html/ref/node6.html#SECTION03350000000000000000

Regards,
Pedro

--
ALSAPAS: ALSA Library bindings for Pascal
http://alsapas.alturl.com





More information about the fpc-pascal mailing list