Jump to content

Flow-control structures: Difference between revisions

Line 632:
=={{header|MUMPS}}==
===GOTO / G===
<p>JumpsThe GOTO command jumps to a label. If the label is not in the current routine, it is necessary to include the circumflex and routine name. <lang MUMPS>GOTO LABEL^ROUTINE</lang>. This does not affect the subroutine stack, only the program pointer.</p><lang MUMPS>GOTO THERE</lang>
 
===HALT / H===
<p>Halt and Hang have the same abbreviation, i.e. "H" but (as a mnemonic) Halt takes no arguments. Halt stops the current process, and clears all Locks and devices in Use.
On the Cache variant of MUMPS, there is a $HALT special variable that can be set, the value of the $HALT special variable is a routine that is called before cleaning up (in effect, a specialized final error trap).</p>
<lang MUMPS> Read "Do you really wish to halt (Y/N)?",Q#1
IF Q="Y"!Q="y" HALT</lang>
 
===JOB / J===
<p> The JOB command starts another MUMPS job starting at a label. If the label is not in the current routine, it is necessary to include the circumflex and routine name. <lang MUMPS>JOB LABEL^ROUTINE</lang>. <lang MUMPS>JOB THERE</lang> This does not affect the subroutine stack, nor the program pointer in the current job. Since MUMPS is a multi-processing (rather than multi-threading) language, the new job is independent of the current job.</p>
<lang MUMPS> JOB LABEL^ROUTINE</lang>
 
 
===QUIT / Q===
22

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.