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

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


2007/1/25, Stefano Palmeri <rospolosco at ...152...>:
>
> Alle 18:10, giovedì 25 gennaio 2007, José Luis Redrejo ha scritto:
> > 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.
> >
>
> Sorry, your code doesn't work.
> I'm talking about a *only console* project.
>

me too. That's an only console project. In fact I have it working in a
non-graphic application, but I wrote from my bad memory and forgot to add ""
in the code. The declaration should be like this:
   hDaemonTimer = NEW Timer as "Timer1"



More information about the User mailing list