☜ | lineref1990 Version of ANSI Standard | ☞ |
The Do and Goto commands, extrinsic functions and extrinsic variables, as well as the $Text function, contain in their arguments means for referring to particular lines within any routine. 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.
dlabel | ::= | │ │ │ |
label @ expratom V dlabel |
│ │ │ |
See 2.4.1 for the definition of label. See 2.2 for the definition of expratom. See section 1 for the definition of V.
routineref | ::= | │ │ │ |
routinename @ expratom V routineref |
│ │ │ |
See 2.4 for the definition of routinename. See 2.2 for the definition of expratom. See section 1 for the definition of V.
The total line specification in Do and Goto is in the form of entryref.
entryref | ::= | │ │ │ |
dlabel [ + intexpr ] [ ^ routineref ] ^ routineref |
│ │ │ |
See 2.2.4.1 for the definition of intexpr.
If the delimiter ^ is absent, the routine being executed is implied. If the line reference (dlabel [+intexpr]) is absent, the first line is implied.
When the Do or Job commands or exfunc or exvar include parameters to be passed to the specified routine, the +intexpr form of entryref is not permitted and the specified line must be a formalline. The line specification labelref is used instead:
labelref | ::= | │ │ │ |
label [ ^ routinename ] ^ routinename |
│ │ │ |
See 2.4.1 for the definition of label. See 2.4 for the definition of routinename.
If + intexpr is absent, the line denoted by dlabel 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.
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, Goto, and Job commands, as well as the $Text function, can refer to a line in a routine other than that in which they occur; this requires a means of specifying a routinename.
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)