[Lazarus] Class operators

Jose Luis jlvolta at fibertel.com.py
Tue May 24 00:06:31 CEST 2011


Hi all:

I've tried to cast the argument 'Sender' from a call to an event
procedure, but it didn't work. The event is triggered by a TSpeedButton
push, and the code of the action call contain the sentence:  

-- if Sender is TSpeedButton then
--      buttn:=TSpeedButton(Sender);

The code compile without raising error or warning, but at run-time
Sender is not of TSpeedButton's type, like it is in Delphi.

What's the correct way to cast objects in FPC ?

Can anybody help me ? Thanks in advance.
I am using lazarus-0.9.28-2 on linux, 0.9.30 on XP, fpc-2.4.2
J.L.












More information about the Lazarus mailing list