[fpc-devel] procedure Types
Aavani at iust.ac.ir
Mon Mar 13 11:08:01 CET 2006
Any idea to call:
BeginThread (@MyObject.F1, Pointer (S))
Michael Van Canneyt wrote:
>On Sat, 4 Mar 2006, Amir Aavani wrote:
>>I have problem with procedure Types.
>>Look at the following code:
>>TProcedure= procedure (S: String);
>>procedure F1 (S: String);
>>procedure F2 (S: String);
>> MyF:= @F1;
>>it says it can't cast "Procedure (S: String); Object" to TProcedure. The
>>problem is clear but I don't know
>>(can't find) any solution to define TProcedure as a procedure of a class which
>>accepts one argument.
>Try the following (note the 'of object' in the declaration):
> TMyStringProc = procedure (S : String) of object;
> MyF : TMyStringProc;
>This is documented.
>fpc-devel maillist - fpc-devel at lists.freepascal.org
More information about the fpc-devel