[Gambas-user] Timer in console projects - help the stupid, please

José Luis Redrejo jredrejo at ...626...
Thu Jan 25 18:10:00 CET 2007


It should be:

PUBLIC hDaemonTimer AS Timer

PUBLIC SUB Main()

  hDaemonTimer = NEW Timer as Timer1
  hDaemonTimer.Delay = 1000
  hDaemonTimer.Enabled = TRUE

END

PUBLIC SUB Timer1_Timer()

  PRINT "hello world!"

END


ANytime you declare a new object that raises events, you shoud use the
syntax:
object=New Class as "whatever"
and the events are received at whatever_event subs.

Regards.


2007/1/25, Stefano Palmeri <rospolosco at ...152...>:
>
> Hi, all.
>
> I'm working on a *console only* project. The problem is that I'm not able
> to make the Timer class working. This is an example code:
>
>
> PUBLIC hDaemonTimer AS Timer
>
> PUBLIC SUB Main()
>
>   hDaemonTimer = NEW Timer
>   hDaemonTimer.Delay = 1000
>   hDaemonTimer.Enabled = TRUE
>
> END
>
> PUBLIC SUB hDaemonTimer_Timer()
>
>   PRINT "hello world!"
>
> END
>
>
> I would expect a printing to stdout every 1 second, but I get
> nothing on console. So, please, help the stupid and tell me what's wrong.
> Gambas2  1.9.47
>
> Thank you all.
>
> Stefano Palmeri
>
>
>
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list