[fpc-pascal] Class procedural type

Paul Ishenin paul.ishenin at gmail.com
Mon Dec 17 23:46:26 CET 2012


18.12.12, 5:26, Ewald пишет:

> Suppose TTestClass contains `AField: Integer; static;`, then the following would be right if I understand you correctly?
>
> Class Procedure TTestClass.AMethod; static;  // I don't know if `static` should be in the implementation as well, but I'll soon figure out :-)
> Begin
> 	AField:= 0;		//Wrong? My guess is it would fail to compile in this case, but I haven't got a compiler at hand now.
>
> 	TTestClass.AField:= 0;	//Right?
> End;

Both calls will work. AMethod still belongs to class, so it first 
searches identifier in that class.

Best regards,
Paul Ishenin



More information about the fpc-pascal mailing list