|
Post by wurlde on Mar 6, 2008 17:23:10 GMT -5
I know it's a little offtopic, but I'm testing some options with RB I usually use Borland C/C++ for this kind of things, but this time I downloaded Just BASIC for making a simple daemon, and I haven't found a "sleep" or a "delay" command... also "RUN" executes programs asynchronously, so a "RUN sleep" won't work either... So, the question is... is there a way to stop a program by a certain amount of time? a "while" can do the trick, but only if you're not going to use it for a long amount of time, you can fry an egg with the micro, 'cause it's always at 100% ideas are welcome thanks in advance
|
|
|
Post by mackrackit on Mar 6, 2008 23:44:07 GMT -5
Not sure if this will help but it may give you an idea. This is for LB, do not know if it will work in JB This program runs for a bit and then will close. [setup.main.Window]
'-----Begin code for #main
nomainwin WindowWidth = 150 WindowHeight = 150 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
'-----Begin GUI objects code
textbox #main.textbox1, 25, 62, 50, 25 '-----End GUI objects code open "untitled" for window as #main print #main, "font ms_sans_serif 10" print #main, "trapclose [quit]"
[loop]
for x = 1 to 100 if x = 50 then exit for gosub [display] calldll #kernel32,"Sleep",50 as ulong,r as void next x goto [quit] scan wait
[display] print #main.textbox1,x return
[quit] 'End the program close #main end
|
|
|
Post by wurlde on Mar 7, 2008 2:34:16 GMT -5
thanks for the answer, but calldll is not available with JB but I've seen a "timer", I think I missed it yesterday because it was too late for me... :S with this, I'm done
|
|