[fpc-pascal] Class procedural type

Sven Barth pascaldragon at googlemail.com
Tue Dec 18 06:38:41 CET 2012


Am 17.12.2012 23:46 schrieb "Paul Ishenin" <paul.ishenin at gmail.com>:
>
> 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.

Right... Forgot about the scope... -.-

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20121218/a88fe81b/attachment.html>


More information about the fpc-pascal mailing list