[fpc-pascal] Local procedures as actual procedure parameter in macpas mode

Alberto Narduzzi albertonarduzzi at yahoo.com
Tue Aug 24 22:38:21 CEST 2010


> Trying to compile the following code (porting from MW Pascal)
> 		procC (procedure procD (var y: myObject));

the compiler is complaining because the ProcB is a nested procedure of 
ProcA.

Try defining it outside the object, if possible.
If not, define it as an object method(*)

I also suggest you do

Type TMyProc Procedure(var y:myObject);
(*) in case of an object method, I think you must add "Of Object" at the 
end of its declaration.

it makes all more readable on first instance.

Just my 2c

Cheers, A.

-- 
Alberto Narduzzi
ANSware Ltd.



More information about the fpc-pascal mailing list