One way is the one you described: many if ... then
Onother could be to divide your main function into different smaller functions and start each of that functions with an IF <timer is active> then ...
I think this request is enough interesting to spend some time and think more if such a situation can be managed nativelly by thinBasic. I mean, something like (I'm just brainstorming):
FUNCTION MyFunction(...) AS <retruntype>... ExitIf <test>
and during execution of function thinBasic will continue test if <test> if true and if yes, than exit.
Of course if MyFunction calls another function not having a similar test the second function will be executed entirely.
But I'm open to any more clever idea
Ciao
Eros
Bookmarks