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

lineref

1984 Version of ANSI Standard

3.5.7 Line References

The DO and GOTO commands, as well as the $TEXT function, contain in their arguments means for referring to particular lines within any routine (in the case of DO and GOTO) or within the routine executing the line reference (in the case of $TEXT). This section describes the means for making line references.

Any line in a given routine may be denoted by mention of a label which occurs in a defining occurrence on or prior to the line in question.

    lineref::= dlabel [ + intexpr ]

See also the transition diagram for lineref.

    dlabel::=

label
@ expratom V dlabel


If + intexpr is absent, the line denoted by lineref is the one containing label in a defining occurrence. If + intexpr is present and has the value n > 0, the line denoted is the nth line after the one containing label in a defining occurrence. A negative value of intexpr is erroneous. When label is an instance of intlit, leading zeros are significant to its spelling.

In the context of DO or GOTO, either of the following conditions is erroneous.

  1. A value of intexpr so large as not to denote a line within the bounds of the given routine.
  2. A spelling of label which does not occur in a defining occurrence in the given routine.

In any context, reference to a particular spelling of label which occurs more than once in a defining occurrence in the given routine will have undefined results.

DO and GOTO can refer to a line in a routine other than that in which they occur; this requires a means of specifying a routine name.

    routineref::=

routinename
@ expratom V routineref


The total line specification in DO and GOTO is in the form of entryref.

    entryref::=

lineref [ ^ routineref ]
^ routineref


See also the transition diagram for entryref.

If the delimiter ^ is absent, the routine being executed is implied. If the lineref is absent, the first line is implied.

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, 13:20:44.

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