Abort command with button...
Posted: Sun Dec 18, 2016 8:22 am
I have a command that can take a long time to complete, so I wanted to give the user a way to abort the running command in case they do not want to wait for the command to complete. The command uses a repeat loop that may run several thousand times.
I created an 'ABORT' button and added the following code:
Within the repeat loop I added this code:
However once the command is running the button does not seem to do anything. It seems as though the running command cannot see that the variable has changed, or that the button is not able to process the mouseup request until the command has finished running? I listed gAbort as a global in both the button and card script.
Is there a way to have the updated variable passed to the command while it is running?
Thanks for any advice or suggestions,
TJ.
I created an 'ABORT' button and added the following code:
Code: Select all
on mouseup
put 1 into gAbort
end mouseup
Code: Select all
if gAbort = 1 then
exit myslowcommand
end if
Is there a way to have the updated variable passed to the command while it is running?
Thanks for any advice or suggestions,
TJ.