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

DO

1990 Version of ANSI Standard

2.6.3 Do

D[O] postcond

[ SP ]
SP L doargument


See 2.5.1 for the definition of postcond. See section 1 for the definition of L.

    doargument::=


entryref postcond
labelref actuallist postcond
@ expratom V L doargument



See 2.5.7 for the definition of entryref. See 2.5.1 for the definition of postcond. See 2.5.7 for the definition of labelref. See 2.5.9 for the definition of actuallist. See 2.2 for the definition of expratom. See section 1 for the definition of V. See section 1 for the definition of L.

An argumentless Do initiates execution of an inner block of lines. If postcond is present and its tvexpr is false, the execution of the command is complete. If postcond is absent, or the postcond is present and its tvexpr is true, the Do places a Do frame containing the current execution location, the current execution level, and the current value of $T on the PROCESS-STACK, increases the execution level by one, and continues execution at the next line in the routine. (See 2.4.2 for an explanation of routine execution.) When encountering an implicit or explicit Quit not within the scope of a subsequently executed doargument, xargument, exfunc, exvar, or For, execution of this block is terminated (see 2.6.15 for a description of the actions of Quit). Execution resumes at the command (if any) following the argumentless Do.

Do with arguments is a generalized call to the subroutine specified by the entryref, or labelref, in each doargument. The line specified by the entryref or labelref, must have a LEVEL of one. Execution of a doargument to a line whose LEVEL is not one is erroneous.

If the actuallist is present in an executed doargument, parameter passing occurs and the formalline designated by labelref must contain a formallist in which the number of names is greater than or equal to the number of actuals in the actuallist.

Each doargument is executed, one at a time in left-to-right order, in the following steps.

  1. Evaluate the expratoms of the doargument.
  2. If postcond is present and its tvexpr is false, execution of the doargument is complete. If postcond is absent, or postcond is present and its tvexpr is true, proceed to the step c.
  3. A Do-frame containing the current execution location and the execution level are placed on the PROCESS-STACK.
  4. If the actuallist is present, execute the sequence of steps described in 2.5.9 Parameter Passing.
  5. Continue execution at the first command following the ls of the line specified by entryref or labelref. Execution of the subroutine continues until an eor or a Quit is executed that is not within the scope of a subsequently executed For, argumentless Do, doargument, xargument, exfunc, or exvar. The scope of this doargument is said to extend to the execution of that Quit or eor. (See 2.6.15 for a description of the actions of Quit.) Execution then returns to the first character position following the doargument.
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 15-Nov-2023, 14:41:58.

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