PDA

View Full Version : Wait function



peralta_mike
05-07-2010, 00:35
Is the keyword Wait reserved for any function or anything in thinbasic?

ErosOlmi
05-07-2010, 06:51
No it is not a reseved key.
You can use for your own variables and/or functions


Uses "console"

Dim wait As Long
wait = 123
PrintL wait
WaitKey


thinBasic uses SLEEP (http://www.thinbasic.com/public/products/thinBasic/help/html/sleep.htm) in order to put your script in sleep for a period. In any case it is not suggested to use sleep because script execution stops for the number of milliseconds indicated.

peralta_mike
05-07-2010, 19:01
Thanks. As it turns out, for external instrument control, putting the script in sleep for a finite number of millisec is actually desirable. One of the few applications where it is wanted. Anyway in my system I have another background process running that works with the front end script in parallel. The whole system is actually pretty cool in it's flexibility and robustness - since the background process can save control settings and variable values that are needed when a series of front end scripts run in sequence or even in parallel if it's set up properly. Later I may prepare a short overview on how the whole system works. I have found it very valuable. Not just for instrument control put also for embedding flexibility between scripts and background processes for other purposes.

ErosOlmi
05-07-2010, 19:10
Great. Having more info will let us better undestand and see if you need more by thinBasic.

Regarding process, check OS module, it has some commands that can help in handling process.
Also \SampleScripts\OS\Process.tbasic example can help to have an idea on available commands working on process.

Ciao
Eros

peralta_mike
06-07-2010, 04:41
Thanks. I noticed those process related commands and it's one of the reasons I picked thin basic. I will be using the process and timing commands heavily.

- mike