[fpc-pascal] Variable of class method type of function

CA Gorski fpc-pascal-list at artelogic.com
Sun Jul 15 15:09:56 CEST 2012


But then I get the following error trying to use the variable:

Error: Incompatible types: got "<class method type of 
function(AnsiString):Boolean of object;Register>" expected "<procedure 
variable type of function(AnsiString):Boolean of object;Register>"



On 15.07.2012 14:13, Jonas Maebe wrote:
> On 15 Jul 2012, at 14:05, CA Gorski wrote:
>
>> How to declare a variable of class method type of function?
>>
>> ...
>> var
>>     MyVar: function(AParam: string): boolean of class;
>> ...
>> gives an error using FPC 2.6.1 (Win64).
> You have to use "of object", just like for a regular method.
>
>
> Jonas
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>





More information about the fpc-pascal mailing list