Kelly wrote:
Hi DavidI'm converting some older code to multitask.
In subroutines where I have used PAUSE or similar, can I just use the
supertimer and do I need to have all "yieldtask" instructions in the
task itself ?
PAUSE, WaitOnT etc. will work in a MultiTrack task. They hold up that task but no others. You don't have to build a Pause using the supertimers.
The supertimers come in where you need to have a loop waiting for something not covered by an existing timed wait, and/or one of several possible outcomes. For example, this loop will continue until timeout or one of two possible events.
;Wait for something to happen, timeout after 60s
MarkTime ;Capture "now"
WaitLoop YieldTask
GoIfInOn iSwitch,GotSw ;Test 1st condition
GoIfST sOverLoad,OvLd ;Test 2nd condition
LoopIfTiming 6000,WaitLoop ;Keep waiting for 60s
GoTo TimeOut
