Semi-Parallel processes
Once we use Refresh() command in the loop we start Semi-Parallel process or what we call Parallel
loop.
That means while the loop is still counting we can interact with any objects,
run other short scripts and make other actions.
See first example: Normal loop
for n=0 to 10000
a=n+1
next n
Normal loop will pause the MMB (it will be inactive) for the time until loop
will finish. You can't click on any buttons during the looping.
This is Parallel loop
for n=0 to 10000
a=n+1
Refresh()
next n
The command Refresh() will process the parallel interactions - that means while the loop is still
looping we can click on buttons and run short scripts.
You have to remember
Any other (parallel or not) loop will pause the first one until the second
will be finished. See the chart below
The loop chart:
You should use Prallel loop only if you are certain what it does.
Example of using infinite loop.
With Parallel loop we can use also infinite loop option. (But you have to
remember to exit)
The script will make the object Circle sticky to the mouse cursor - until some
other object doesn't set the stop to 1.
stop = 0
for n=0 to infinity
MoveObject("Circle","MOUSEX( ),MOUSEY( )")
if (stop=1) then
Return()
end
Refresh()
next n