Flow-control structures: Difference between revisions
Content added Content deleted
DavidWhitten (talk | contribs) m (→HALT / H) |
DavidWhitten (talk | contribs) |
||
Line 632: | Line 632: | ||
=={{header|MUMPS}}== |
=={{header|MUMPS}}== |
||
===GOTO / G=== |
===GOTO / G=== |
||
<p> |
<p>The 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=== |
===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. |
<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> |
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 |
<lang MUMPS> Read "Do you really wish to halt (Y/N)?",Q#1 |
||
IF Q="Y"!Q="y" HALT</lang> |
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=== |
===QUIT / Q=== |