Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Nov 19, 2017 7:11 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: RaiseEvent usage
PostPosted: Mon Mar 04, 2013 3:20 am 
Offline

Joined: Mon Feb 27, 2012 6:04 am
Posts: 4
Hi,

I have a subclass of a Serial class named SER. In the SER subclass I declared a Timer (tTimer) and a public method (Open) for the SER.
And I declared a tTimer_Action(Sender As Timer) method for the Timer.

So in the Open method I init:
tTimer = new Timer
tTimer.Period = 500
tTimer.Mode = 0
Addhandler tTimer.Action, AddressOf tTimer_Action

In addition I declared a TimerAction event in a SER subclass, like:

Sub tTimer_Action(Sender As Timer)

//do something...
Dim x As Integer = 0

RaiseEvent TimerAction

End Sub

My problem is the Raiseevent do not work. If I add a breakpoint inside the tTimer_Action method before the RaiseEvent, everything is OK BUT the TimerAction event won't called...

What is the problem? I missed something?
Thanks


Top
 Profile  
Reply with quote  
 Post subject: Re: RaiseEvent usage
PostPosted: Mon Mar 04, 2013 3:37 am 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
RaiseEvent calls the event in a subclass of SER. Events are called by the Super, not by the class itself. If you put an instance of SER on the window and put code in the TimerAction event in the window's code editor, then that code would execute. Or if you create another class and make its Super SER, and fill out code in the TimerAction event handler, it would execute. But RaiseEvent in SER does not execute code in SER. Only in a subclass/instance of SER.


Top
 Profile  
Reply with quote  
 Post subject: Re: RaiseEvent usage
PostPosted: Mon Mar 04, 2013 3:41 am 
Offline

Joined: Mon Feb 27, 2012 6:04 am
Posts: 4
Ok, thank You for the quick reply! It works!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group