M[UMPS] Commands

K[ILL]

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

KILL A,B,C,^A,^B,^C
KILL (A,B,C)

Note that KILL (A(1),B) is not allowed.

Additions in a future ANSI M[UMPS] language standard.

In addition to the previous indirection capabilities, the possibility to KILL (A,B,@C,D) with C equal to "P,Q,R" is included.

When the traditional KILL command removes information, it removes any value, and any descendants of the variables affected. The addition is that two new commands are introduced (see command KSUBSCRIPTS and command KVALUE) that allow for a more selective removal of information.

 NEW
 DO SETUP
 KSUBSCIPTS A,B,C
 ; A should be unchanged
1 IF $DATA(A)'=1 DO ERROR(1)
 ; B(10) should have been deleted
2 IF $DATA(B)'=0 DO ERROR(2)
 ; Only C(11) should have been deleted
3 IF $DATA(C)'=1 DO ERROR(3)
 DO SETUP
 KVALUE A,B,C
 ; A should have been deleted
4 IF $DATA(A)'=0 DO ERROR(4)
 ;B should be unchanged
5 IF $DATA(B)'=10 DO ERROR(5)
 ; C should be deleted, C(11) should remain
6 IF $DATA(C)'=10 DO ERROR(6)
 DO SETUP
 KSUBSCRIPTS (A,B)
 ; A should be unchanged
7 IF $DATA(A)'=1 DO ERROR(7)
 ; B(10) should be unaffected
8 IF $DATA(B)'=10 DO ERROR(8)
 ; Only C(11) should have been deleted
9 IF $DATA(C)'=1 DO ERROR(9)
 DO SETUP
 KVALUE (A,B)
 ; A should be unchanged
10 IF $DATA(A)'=1 DO ERROR(10)
 ; B(10) should be unchanged
11 IF $DATA(B)'=0 DO ERROR(11)
 ; Only C should have been deleted
12 IF $DATA(C)'=10 DO ERROR(12)
 DO SETUP
 KILL A,B
 ; A should have been deleted
13 IF $DATA(A)'=0 DO ERROR(13)
 ; B(10) should have been deleted
14 IF $DATA(B)'=0 DO ERROR(14)
 ; Both C and C(11) should be unaffected
15 IF $DATA(C)'=11 DO ERROR(15)
 DO SETUP
 KILL (A,B)
 ; A should be unaffected
16 IF $DATA(A)'=1 DO ERROR(16)
 ; B(10) should be unaffected
17 IF $DATA(B)'=10 DO ERROR(17)
 ; Both C and C(11) should have been deleted
18 IF $DATA(C)'=0 DO ERROR(18)
 QUIT
SETUP SET A=1,B(10)=10,C=11,C(11)=11 QUIT
ERROR(I) WRITE !,"Error in check # ",I
 WRITE !,$TEXT(@I)
 QUIT

Examples with naked references:

KILL VARIABLE
SET ^ABC(1,2)="reset naked indicator"
; Naked indicator is now ^ABC(1,
KILL ^(3,4)

; Naked indicator is now: ^ABC(1,3,
; Actual reference is: ^ABC(1,3,4)


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.

This document describes the various commands that are defined in the M[UMPS] language standard (ANSI X11.1, ISO 11756).

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

In this document, information is included that will appear in future standards.
The MDC cannot guarantee that these 'next' standards will indeed appear.