☜ | Routine ExecutionDraft MDC Standard | ☞ |
Routines are executed in a sequence of blocks. Each block is dynamically defined and is invoked by an instance of an argumentless Do command, a Job command (in the case of a new process), a doargument, an exfunc, or an exvar. Each block consists of a set of lines that all have the same LEVEL; the block begins with the line reference implied by the Do, Job, exfunc, or exvar and ends with an implicit or explicit Quit command. If no label is specified in the doargument, jobargument, exfunc, or exvar, the first line of the routinebody is used. The execution level is defined as the LEVEL of the line currently being executed. Lines which have a LEVEL greater than the current execution level are ignored, i.e., not executed.
Editor’s note: (See X11/1999–7): Change the end of this sentence to: ... are usually ignored (i.e. not executed), except when the line in question is reached as the result of an argumented Do command, in which case an error will occur with ecode="M14".) |
An implicit Quit command is executed when a line with a LEVEL less than the current execution level or the eor is encountered, thus terminating this block (see 8.2.26 for a description of the actions of Quit). The initial LEVEL for a process is one. The argumentless Do command increases the execution level by one. (See also the Do command and Goto command).
Within a given block execution proceeds sequentially from line to line in top to bottom order. Within a line, execution begins at the leftmost command and proceeds left to right from command to command. Routine flow commands Do, Else, For, Goto, If, Quit, TREstart, Xecute, exfunc and exvar extrinsic functions and special variables, provide exception to this execution flow. (See also 6.3.2 Error Processing.) In general, each command’s argument is evaluated in a left-to-right order, except as explicitly noted elsewhere in this document.
Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.
Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.
This page most recently updated on 17-Nov-2023, 10:33:43.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)