[Gambas-user] Gambas EVENT - RAISE

timothy timothy.marshal-nichols at ...247...
Wed Mar 14 20:36:23 CET 2007


> -----Original Message-----
> From: gambas-user-bounces at lists.sourceforge.net [mailto:gambas-user-
> bounces at lists.sourceforge.net] On Behalf Of Vince Scott (SBC)
> Sent: Wednesday, 14 March 2007 02:47 PM
> To: gambas-user at lists.sourceforge.net
> Subject: [Gambas-user] Gambas EVENT - RAISE
> 
> Hello,
> 
> 
> 
> I'm using Gambas version 1.9.46 and cannot get the EVENT - RAISE event
to
> work. I need my classes to be able to generate an event. Can anyone
help
> me?
> I try accessing the archives on the web site but the page seems to be
> broken.
> 
> 
> 
> Vince
> 

Create a new class and place this code in it


PRIVATE Ten AS Timer

PUBLIC SUB _new()
  Ten = NEW Timer AS "Ten"
  Ten.Delay = 5000
  Ten.Enabled = TRUE
END

EVENT Pulse(t AS Date)

PUBLIC SUB Ten_Timer()
  RAISE Pulse(Now)
END


Now put this code in your startup form:


PRIVATE Pulse AS Every5Seconds

PUBLIC SUB Form_Open()
  Pulse = NEW Every5Seconds AS "Pulse"
END

PUBLIC SUB Pulse_Pulse(t AS Date)
  PRINT t
END


You should see the time printed every 5 seconds.

Thanks

8-{)} Timothy Marshal-Nichols
<mailto: timothy.marshal-nichols at ...247...>








More information about the User mailing list