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

QUIT

1990 Version of ANSI Standard

2.6.15 Quit

Q[UIT] postcond

[ SP ]
SP expr


See 2.5.1 for the definition of postcond. See 2.3 for the definition of expr.

Quit terminates execution of an argumentless Do command, doargument, xargument, exfunc, exvar, or For command.

Encountering the end-of-routine mark eor is equivalent to an unconditional argumentless Quit.

The effect of executing Quit in the scope of For is fully discussed in 2.6.5. Note the eor never occurs in the scope of For.

If an executed Quit is not in the scope of For, then it is in the scope of some argumentless Do command, doargument, xargument, exfunc, or exvar if not explicitly then implicitly, because the initial activation of a process, including that due to execution of a jobargument, may be thought of as arising from execution of a Do naming the first executed routine of that process.

The effect of executing a Quit in the scope of an argumentless Do command, doargument, xargument, exfunc, or exvar is to restore the previous variable environment (if necessary), restore the value of $T (if necessary), restore the previous execution level, and continue execution at the location of the invoking argumentless Do command, doargument, xargument, exfunc, or exvar.

If the expr is present in the Quit, this return must be to an exfunc or exvar. Similarly, if the expr is not present, the return must be to an argumentless Do command, doargument or xargument. Any other case is erroneous.

The following steps are executed when a Quit is encountered:

  1. If an expr is present, evaluate it. This value becomes the value of the invoking exfunc or exvar.
  2. Remove the frame on the top of the PROCESS-STACK. If no such frame exists, then execute an implicit Halt.
  3. If that frame is from a New, examine the saved argument of the New and take one of the following actions dependent on the argument types:
    1. Selective New
      perform an implicit Kill on the argument lname.
    2. Exclusive New
      perform an implicit Kill on all names in the NAME-TABLE except those in the argument of the New.
    3. New All
      perform an implicit Kill ALL.
    Finally, copy all NAME-TABLE entries from the frame into the NAME-TABLE.
    Processing of this frame is complete, continue at step b.
  4. If the frame is a parameter frame, extract the formallist and process each name in the list with the following steps:
    1. Search the NAME-TABLE for an entry containing the name. If no such entry is found, processing of this name is complete. Otherwise, proceed to step 2.
    2. Delete the NAME-TABLE entry for this name.
    Finally, copy all NAME-TABLE entries from this frame into the NAME-TABLE.
    Processing of this frame is complete, continue at step b.
  5. If the frame is from an exfunc or exvar or from an argumentless Do command, set the value of $T to the value saved in the frame.
  6. Restore the execution level and continue execution at the location specified in the frame.
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:46:53.

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