 |
Chris_3413 Novice
Joined: 22 Mar 2004 Posts: 46 Location: Australia
|
Posted: Tue Nov 29, 2005 8:11 am
Stopping #REPEAT |
Just wondering if theres any way to manually stop the #REPEAT command before it finishes looping the specified number of times
Theres a few places where ive used it for some complex but repetitive sets of tasks and then found myself almost paralysed when an emergency happens due to having to wait for it to complete |
|
_________________ What do you mean, Fatal Error! |
|
|
 |
Slaem Apprentice
Joined: 20 Sep 2005 Posts: 135
|
Posted: Tue Nov 29, 2005 8:58 am |
Try #ABORT ?
|
|
|
|
 |
Chris_3413 Novice
Joined: 22 Mar 2004 Posts: 46 Location: Australia
|
Posted: Tue Nov 29, 2005 9:20 am |
Tried that, didnt work
|
|
_________________ What do you mean, Fatal Error! |
|
|
 |
darkspot Apprentice
Joined: 29 Jul 2002 Posts: 105
|
Posted: Tue Nov 29, 2005 10:24 am |
| Code: |
#repeat 5 {#say %i;#abort}
|
stopped after only printing 1 for me.. *shrug*
then I further tested..
| Code: |
#repeat 5 {#say %i;#if (%i=2) {#say pretest;#abort;#say posttest}}
|
and it printed
1
2
pretest
3
4
5
so I looked at the help file.. and VIOLA
| Code: |
#repeat 5 {#say %i;#if (%i=2) {#say pretest;#abort 1;#say posttest}}
|
1
2
pretest
so try #abort 1? seemd to cancel everything going on..? not quite sure what lengths it goes to. |
|
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Tue Nov 29, 2005 1:03 pm |
#ABORT
By itself will stop the *current* script. So you see in your first example the #SAY posttest doesn't happen as the abort stopped that script.
#ABORT 1
This stopped *all* scripts so the repeat queue of commands was halted.
//
Syntax: #ABORT [flag]
Aborts further parsing of the current command line. Commands after this on the same line are discarded. Aborts processing of current program block.
[color=red]If the flag is present and non-zero, all active scripts are aborted instead of just the current program block.[/red] |
|
|
|
 |
Pseudo Wanderer
Joined: 25 Oct 2005 Posts: 99
|
Posted: Tue Nov 29, 2005 1:22 pm |
To manually stop the current script, I press the Escape key.
|
|
|
|
 |
|
|
|