[Gambas-user] Timer in Script

Rolf-Werner Eilert eilert-sprachen at ...221...
Wed Dec 10 15:45:21 CET 2008


Stefano Palmeri schrieb:
> Il mercoledì 10 dicembre 2008 10:52:24 Rolf-Werner Eilert ha scritto:
>> Hello experts!
>>
>> Can I use a Timer control in a scripted Gambas program, and if yes, how?
>> And if not, is it possible in a non-graphical Gambas program?
>>
>> Thanks for any hints.
>>
>> Rolf
>>
> 
> Don't know about scripted Gambas program, but for a shell 
> program you cloud do:
> 
> -----------------------------------------------------------------------------
>  ' Gambas module file
> 
> PUBLIC hConsoleTimer AS Timer 
> 
> PUBLIC SUB Main()
>     
>   hConsoleTimer = NEW Timer AS "MyTimer"
>   hConsoleTimer.Delay = 1000
>   hConsoleTimer.Enabled = TRUE
>   
> END
> 
> PUBLIC SUB MyTimer_Timer()
>   
>   PRINT "Hello Gambas" 
>   
> END
> ---------------------------------------------------------------
> 
> Bye,
> 
> Stefano
> 
> 


A scripted program seems to be one big SUB or FUNCTION, so I got errors 
until I changed everything into one big single code without calling any 
SUBs or FUNCTIONs. This runs good. Without a timer, of course.

Thanks for your example. This might be a solution, and this gives me 
another idea, I'll be back later :-)

Rolf





More information about the User mailing list