[fpc-pascal]About "callbacks method" of a class

mili milimeter at 163.com
Thu Nov 14 09:00:22 CET 2002


Hi,

  Actually it's the same problem, I tried to connect TSomeClass.FuncName with 
a signal, which caused problem. Yesterday I thought perhaps I can make a 
callbacks function to be a nested function, then it will be invisible to 
other places. Now I know I was wrong. It seems there's no good way to 
encapsulate a callback completely into a class.

  Now I have write a 
>> Why the
>> following code can compile but will run with "Access violation"?
>> >>>>>
>> procedure TSomeClass.FuncName(...);
>>   procedure FuncNameEmbeded(...);
>>   begin
>>     .....
>>     writeln(FValue);//Here FValue is a member (Integer) of TSomecalss
>>     .....
>>   end;//FuncNameEmbeded
>> begin
>> end;//TSomeClass.FuncName
>> <<<<<

>Looks like good code.
>Can you send more (class definition and code, that calls FuncName)?

>Mattias Gaertner





More information about the fpc-pascal mailing list