Flow-control structures: Difference between revisions

adding MUMPS information
(Shortened the contents table by changing third level of hierarchy into just bold text)
(adding MUMPS information)
Line 521:
* loop control with <code>'''break''' [label]</code> ([http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/break]) and <code>'''continue''' [label]</code> ([http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/continue])
* exceptions with <code>'''throw'''</code> ([http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/throw]) and <code>'''try ... catch ... finally ...'''</code> ([http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/try...catch])
=={{header|MUMPS}}==
 
===GOTO / G===
<p>Jumps to a label.This does not affect the stack, only the program pointer.</p><lang MUMPS>GOTO THERE</lang>
===HALT / H===
<p>Halt and Hang have the same abbreviation, but (as a mnemonic) Halt takes no arguments. Halt stops the current process, and clears all Locks and devices in Use. If the $HALT special variable is set, that routine is called before cleaning up (in effect, a specialized error trap).</p>
<lang MUMPS> Read "Do you really wish to halt (Y/N)?",Q#1
IF Q="Y"!Q="y" HALT</lang>
===QUIT / Q===
<p>Exits a loop, or routine. It decreases the stack level. It can return a value to a calling routine if there is a value after it.</p><p>Quit is one of the commands that requires two spaces after it if it is followed in a line by more commands.</p>
<lang MUMPS>FOR I=1:1:1 QUIT:NoLoop DO YesLoop
QUIT Returnvalue</lang>
===XECUTE / X===
<p>eXecute acts as if it were a one line Do command. Its argument must be a string of valid MUMPS code, and it performs that code in a new stack level. There is an implied Quit at the end of each eXecute's argument string.</p><lang MUMPS> SET A="SET %=$INCREMENT(I)",I=0
XECUTE A
WRITE I</lang>
The above block will output "1".
 
=={{header|OCaml}}==