
|
Page: Procedures - MUMPS Routines
Main article
| Home > Child Health > Procedures - MUMPS Routines |
A typical M procedure (a "routine" in MUMPS terminology) is analogous to a source file in C (with respect to namespace scope and variable lifetime, for instance) and consists of lines of MUMPS code. Line / statement labels can be used to create memory resident subroutines within the routine's scope by simply prefixing the line with a label. The same subroutine can be used from outside the parent routine's scope by referencing the Label and routine name separated by an 'up-arrow' character (actually the caret, as in SUBRTN^ABC).
Calling the procedure/routine at the beginning of the line uses the routine name which starts with the caret (e.g. ^ABC as DO ^ABC). Within the routine ^ABC, labels are defined by starting a line with a label instead of a space or tab. One may reference the labeled line within the parent routine as DO SUBX, or outside as DO SUBX^ABC. It may or may not have a variable number of arguments and may return a value as a function.
|
Important notice:
The content is not intended to be a substitute for professional medical advice, diagnosis, or treatment. Always seek the advice of your physician or other
qualified health provider with any questions you may have regarding a medical condition.
|