M[UMPS] Commands

G[OTO]

Introduced in the 1977 ANSI M[UMPS] language standard.

GOTO LABEL

GOTO LABEL+OFFSET
Note that use of the LABEL+OFFSET syntax may have unintended ramifications when lines of code are inserted between the line with the LABEL and the line that was indicated by LINE+OFFSET before the insertion.

GOTO ^PROGRAM

GOTO LABEL^PROGRAM

GOTO LABEL+OFFSET^PROGRAM

GOTO @ARGUMENT

GOTO @INDLABEL^PROGRAM

GOTO @INDLABEL^@INDPROG

Note: a reference like +OFFSET^ROUTINE is acceptable as a parameter for $TEXT, but not as an argument for the commands DO and GOTO.

Addition in the 1995 ANSI M[UMPS] language standard.

Assume that the following code occurs in a routine called ROUTINE1
 ;...
 GOTO LABEL1^ROUTINE2
 ;...
 DO
 . ;...
LABEL3 . ;...
 . IF CONDITION GOTO LABEL3
 . ;...
 . IF CONDITION GOTO LABEL3^ROUTINE1
 . ; ...
 . GOTO LABEL2^ROUTINE3

The first GOTO command will transfer control to LABEL1 in ROUTINE2.
Assuming that no lines of level 1 occur between the argumentless DO command and the further GOTO commands, the second GOTO command will transfer control to LABEL3 in ROUTINE1, as will the third
GOTO command. The fourth GOTO command will cause an error (M45).

EXAMPLE DO
 . GOTO DEST
DEST QUIT

This example will cause an error (M45) to occur. It is not allowed to jump outside of an indented block by means of a GOTO command.

Examples with naked references:

GOTO DESTINATION
SET ^ABC(1,2)="reset naked indicator"
; Naked indicator is now ^ABC(1,
GOTO @^(3,4)

; Naked indicator is now: ^ABC(1,3,
; Actual reference is: ^ABC(1,3,4)


This document is © Ed de Moel, 1995-2005.
It is part of a book by Ed de Moel that is published under the title "M[UMPS] by Example" (ISBN 0-918118-42-5).
Printed copies of the book are no longer available.

This document describes the various commands that are defined in the M[UMPS] language standard (ANSI X11.1, ISO 11756).

The information in this document is NOT authoritative and subject to be modified at any moment.
Please consult the appropriate (draft) language standard for an authoritative definition.

In this document, information is included that will appear in future standards.
The MDC cannot guarantee that these 'next' standards will indeed appear.