Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Chris_3413
Novice


Joined: 22 Mar 2004
Posts: 46
Location: Australia

PostPosted: 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!
Reply with quote
Slaem
Apprentice


Joined: 20 Sep 2005
Posts: 135

PostPosted: Tue Nov 29, 2005 8:58 am   
 
Try #ABORT ?
_________________
Show your love.
Support Zugg Software!
Donate to zugg@zuggsoft.com with PayPal Send Money.
Reply with quote
Chris_3413
Novice


Joined: 22 Mar 2004
Posts: 46
Location: Australia

PostPosted: Tue Nov 29, 2005 9:20 am   
 
Tried that, didnt work
_________________
What do you mean, Fatal Error!
Reply with quote
darkspot
Apprentice


Joined: 29 Jul 2002
Posts: 105

PostPosted: 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.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: 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]
Reply with quote
Pseudo
Wanderer


Joined: 25 Oct 2005
Posts: 99

PostPosted: Tue Nov 29, 2005 1:22 pm   
 
To manually stop the current script, I press the Escape key.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net