M[UMPS] Functions - $M[UMPS]

Approved for inclusion in a future ANSI M[UMPS] language standard.

This function returns a value that indicates whether the text that was passed to the function as a parameter is valid M[UMPS] code.

SET X="SET A=P+Q"
WRITE $MUMPS(X)

will return the value 0.

SET X="SET A=P+$ZB"
WRITE $MUMPS(X)

will return the either value 0 or an implementation-specific value.

SET X="SET A=1/0"
WRITE $MUMPS(X)

will return the value 0.
Note that the function $MUMPS checks for syntactic correctness, not for semantic correctness.

SET X="SET A=$PIECE($HOORLOG,"","",2)"
WRITE $MUMPS(X)

will return an implementation-specific value, for instance "20;S20;Unknown svn".

Examples with naked references:

$MUMPS(EXPR)
SET ^ABC(1,2)="reset naked indicator"
; Naked indicator is now ^ABC(1,
SET ^(3,4)=$MUMPS(^(5,6))

; 1. fetch ^(5,6) = ^ABC(1,5,6)
; 2. store ^(3,4) = ^ABC(1,5,3,4)
; Naked indicator is now: ^ABC(1,5,3,


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.