Difference between revisions of "@break"
Latest revision as of 20:05, 15 December 2005
@break stops the execution of further commands in the current action list if its argument is a true value. It doesn't affect new queue entries made by previous commands in the action list. Very useful to people who don't like @switch.
> @va obj=$testme *:@pemit %#=Before;@break %0;@pemit %#=After > testme 0 Before After > testme 1 Before
In the last example, the @switch is run, which queues 'think 3rd', 'think 1st' is run, displaying '1st', command execution is broken (so we never 'think 2nd', and then the queued 'think 3rd' is run, displaying '3rd'.
If you follow that, you have a very good understanding of the MUSH queue. :)
Related Topics: BOOLEAN VALUES
PennMUSH provides an extended syntax: @break <boolean> = <command list>. If the <boolean> evaluates to true, execution of further commands in the current action list is replaced by execution of the new <command list>.