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

fpanasiti at tiscali.it fpanasiti at tiscali.it
Tue Aug 24 19:29:19 CEST 2010


Trying to compile the following code (porting from MW Pascal)
	type  
	
myObject = object
		procA (x: integer);
		procC (procedure procD (var 
y: myObject));
	end;
	procedure  myObject. procC (procedure procD (var 
y: myObject));
	begin
		procD (y);
		{more code here ...}
	end;
	
procedure myObject.ProcA (x: integer);
		procedure ProcB (var y: 
myObject);
		begin
			{some code here ...}
		end;
	begin
		procC
(ProcB);
	end;

I get the following error:
 - Got "myObject.ProcB (var 
myObject) is nested;", expected "<procedure variable type of procedure
(var myObject) is nested;Register>"
Apparently the compiler is 
considering ProcB to be a method of myObject (which is not the case, as 
it is not included in the object definition), thus I'm wondering if it 
comes from a wrong syntax I'm using .
Thanks in advance for any help.


Regards
Francesco Panasiti


Risparmia con Tutto Incluso Light: telefono + adsl 8 mega a soli 19,95 € al mese per un anno!

SCONTO DI 120 EURO! 

http://abbonati.tiscali.it/telefono-adsl/prodotti/tc/tuttoincluso_light/?WT.mc_id=01fw



More information about the fpc-pascal mailing list