[Gambas-user] Re: Time Help

Eldon Eller eeller at ...826...
Wed Jun 15 20:04:59 CEST 2005


Assume the desired speed, 6:1 or 4:1, etc., is in the form of a string, s. 
Perhaps s is read from a textbox, for example. The delay (assuming s is in ticks 
per second) may be set as
timer1.delay=1000/eval(replace$(s,":","/")) '1000 because delay is set in ms.
Don't forget to adjust your display to take into account the period of a tick.

As to executable, this is a linux, not Gambas, feature. Despite the trappings of 
a graphical user interface, linux is, at heart, a command line driven OS. You 
cannot run an executable by clicking on it. Instead, use the k menu to open "Run 
Command...", then enter the full path name of your executable. (If the 
executable is in a directory listed by $PATH, you need only the executable 
name.) If you want to start your program with a click, you can add it to the k 
menu with the menu editor, accessible by right clicking the k menu icon.

Michael Murphy wrote:
> Thanks for the help guys, my clock is now 98% working. :)
> 
> Two more questions:
> 
> I want the user to be able to change the speed of the clock, I know
> how to let the user change the speed (timer1.delay = textbox.text).
> What I want to know is if the user wants to enter the speed 6:1 or 4:1
> ect. since this is the way clock speed is usually thought of this way.
> But when I do this I get the error "string entered, int expected" or
> something like that. How do I make it so the program can take this in?
> Something tells me there is a math operation involved or something but
> I'm not to sure. If you need me to explain my problem better please
> let me know.
> 
> My other question is making the program executable. I know how to do
> this but my system does not know how to run the executable. It pops up
> asking me what program to use to run it. Any help here is appreciated.
> :)
> 
> I'm new to programing with Gambas (have programed in visual basic) but
> I never did a program like this (has you can tell). Thanks again.




More information about the User mailing list