Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

Routine Execution

1990 Version of ANSI Standard

2.4.2 Routine Execution

MUMPS routines are executed in a sequence of blocks. Each block is dynamically defined and is invoked by the instance of an argumentless Do command, 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, exfunc, or exvar and ends with an implicit or explicit Quit command. If no label is specified in the doargument, 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. 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 2.6.15 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 routine or subroutine execution proceeds sequentially from line to line in top to bottom order, starting with the line specified by the invoked label or first line of the routine if no label is given. 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, Xecute, exfunc and exvar extrinsic functions and variables, provide exception to this execution flow. Within a command, all expratoms are evaluated in a left-to-right order with all expratoms that occur to the left of the expratom being evaluated, including the complete resolution of any indirection, prior to the evaluation of that expratom, except as explicitly noted elsewhere in this document. The expratom is formed by the longest sequence of characters that satisfies the definition of expratom.

It is an error to begin execution of any formalline unless that formalline has just been reached as a result of an exvar, an exfunc, or a Do command doargument that contains an actuallist.

Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

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.

This page most recently updated on 17-Nov-2023, 10:33:43.

For comments, contact Ed de Moel (demoel@jacquardsystems.com)