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

$PRINCIPAL

M[UMPS] by Example

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

This variable identifies the principal (initial) input/output device of a M[UMPS] process.

Many programs use the non-standard extension that the principal device can be accessed by executing the command Use 0. This practice led to a number of ambiguous conditions (e.g. does "LPT1:" identify the printer or the principal device (+"LPT1:"=0)?). The standardized way of making the principal device current is to Use $Principal.

Use "LPT1" ; (DOS)
Use "SYS$PRINT" ; (VMS)
Use "\dev\usr\pharm\prtr" ; (UNIX)
If 'device ... ; does that really mean ‘principal device’? In the above examples it probably does not.

Sometimes, we just need to know ‘where we are’:
Do ^OWNPROG
Do ^%LIBPROG
Use $Principal Write !,"Do we need to say more?"

Approved for addition in a future M[UMPS] Language Standard.

The initial value of $Principal is implementation-dependent. However, if a job is initiated by another M[UMPS] process, then the new job will inherit the value of $Principal from the initiating job, and if a job is initiated from a specific device, the value of $Principal will be the identifier for that device. Otherwise, the value of $Principal is not specified. Note: $Principal is a constant, i.e. the initial value of $Principal cannot be modified at any time.

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.

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

Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.

This page most recently updated on 15-Nov-2023, 12:08:12.

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