Mumps Class 11

From VistApedia
Revision as of 14:36, 2 April 2011 by Shabiel (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Using username "worldvistaEHR".
Authenticating with public key "rsa-key-20101206"
Linux cassandra 2.6.26-1-686 #1 SMP Fri Mar 13 18:08:45 UTC 2009 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Jan 26 04:22:25 2011 from 192.168.56.1
worldvistaEHR@cassandra:~$ gtm

GTM>; To see the Stack in GT.M

GTM>; ZSHOW "S"

GTM>; or ZSHOW by default executes ZSHOW "S"

GTM>ZSHOW "S"
+1^GTM$DMOD    (Direct mode)

GTM>D ^XUP

Setting up programmer environment
This is a TEST account.

Access Code: *********
Terminal Type set to: C-VT100

Select OPTION NAME:
%GTM-I-CTRLC, CTRL_C encountered

EHR:cassandra>; Ctrl-C, when enabled, stops you in the middle

EHR:cassandra>zshow "S"
PR1+2^DIC11    (Direct mode)
PROMPT+1^DIC11
PROMPT+1^DIC1
ASK+3^DIC
XQ1+2^XQ1
ZIS2+8^XUP
+1^GTM$DMOD    (Direct mode)

EHR:cassandra>; $STACK

EHR:cassandra>WRITE $STACK
6
EHR:cassandra>; $STACK shows you how high are you in the stack

EHR:cassandra>; $STACK can give you information on each of the levels

EHR:cassandra>W $STACK(1,"PLACE")
ZIS2+8^XUP
EHR:cassandra>W $STACK(1,"MCODE")
 D KILL1^XUSCLEAN S $P(XQXFLG,U,3)="XUP" D ^XQ1
EHR:cassandra>W $STACK(1,"ECODE")

EHR:cassandra>; $STACK with 2 subscripts (first one = stack level; next one is a
n Identifier) gives you information on the actual levels of the stack.

EHR:cassandra>D ^XTER


In response to the DATE prompt you can enter:
     'S' to specify text to be matched in error or routine name


No error logged on 2/20/2011

Which date? > ?
Errors have been logged on: T-75(9), T-76(49), T-94(21), T-95(1), T-96(24), T-11
1(1), T-112(9), T-119(11), T-120(388), T-139(8), T-157(2), T-158(3), T-166(3), T
-174(8), T-234(18), T-238(2), T-241(54), T-247(7), T-254(9), T-255(14), T-257(1)
, T-258(7), T-259(5), T-261(3), T-274(15), T-275(4), T-278(2), T-284(6), T-285(1
6), T-290(7), T-297(5), T-310(1), T-346(4), T-363(2), T-402(1), T-403(2), T-481(
1), T-1151(4)

Enter:
     '^Q'  or  '^'  or <RETURN> to quit
     Date as 'DD' or 'MM/DD' or 'MM/DD/YY' or 'T'  or 'T-1'
               (note: 'T' as in Today)
     'S' to specify text to be matched in error or routine name

Which date? > T-75
9 errors logged on 12/7/2010
  9)  <(SOCKWRITE)>SNDERR+4^BMXMON    12:42:46  EHR,EHR     6602  0
  8)  <(SOCKWRITE)>SNDERR+4^BMXMON    12:29:27  EHR,EHR     6503  0
  7)  <(SOCKWRITE)>SNDERR+4^BMXMON    10:51:47  EHR,EHR     6303  0
  6)  <(SOCKWRITE)>SNDERR+4^BMXMON    00:34:12  EHR,EHR     5133  0
  5)  <(SOCKWRITE)>SNDERR+4^BMXMON    00:23:13  EHR,EHR     5108  0
  4)  <(SOCKWRITE)>SNDERR+4^BMXMON    00:22:35  EHR,EHR     5094  0
  3)  <(SOCKWRITE)>SNDERR+4^BMXMON    00:21:37  EHR,EHR     5083  0
  2)  <(SOCKWRITE)>SNDERR+4^BMXMON    00:18:47  EHR,EHR     5071  0
  1)  <(SOCKWRITE)>SNDERR+4^BMXMON    00:15:58  EHR,EHR     5043  0

No screened error

     Enter '^' to quit listing, <RETURN> to continue...: 9

Process ID:  6602  (6602)               DEC 07, 2010 12:42:46

UCI/VOL: [EHR,EHR]

$ZA:   9

Current $IO: 0                          Current $ZIO: 0^0^52^0

$ZE= SNDERR+4^BMXMON, Write to a TCP/IP socket failed,150376602,-%GTM-E-SOCKWRIT
E

    W $C($L(X))_X W !

Last Global Ref: ^SAM(1)

Which symbol? > ^L


$DEVICE=1,Broken pipe
$ECODE=,Z150376602,
$ESTACK=6
$ETRAP=D ^%ZTER HALT
$QUIT=0
$STACK=6
$STACK(000)=-run GTMLNX^XWBTCPM
$STACK(000,"ECODE")=
$STACK(000,"PLACE")=SESSRES+7^BMXMON
$STACK(000,"MCODE")=    U $P D SESSMAIN
$STACK(001)=DO
$STACK(001,"ECODE")=
$STACK(001,"PLACE")=SESSMAIN+5^BMXMON
$STACK(001,"MCODE")=    F  D  Q:BMXTBUF="#BYE#"
$STACK(002)=DO
$STACK(002,"ECODE")=
$STACK(002,"PLACE")=SESSMAIN+10^BMXMON
$STACK(002,"MCODE")=    . I 'BMXHTYPE S BMXTBUF="#BYE#" D SNDERR W BMXTBUF,$C(4)
,! Q
$STACK(003)=DO
     Enter '^' to quit listing, <RETURN> to continue...: ^

$ZE= SNDERR+4^BMXMON, Write to a TCP/IP socket failed,150376602,-%GTM-E-SOCKWRIT
E

    W $C($L(X))_X W !

Last Global Ref: ^SAM(1)

Which symbol? >

Which error? >

Which date? >
EHR:cassandra>; Error Trap

EHR:cassandra>; D ^XTER

EHR:cassandra>; Or menu option

EHR:cassandra>D ^XUP

Setting up programmer environment
This is a TEST account.

Terminal Type set to: C-VT100

Select OPTION NAME: EVE
     1   EVE       Systems Manager Menu
     2   EVENT CAPTURE (ECS) EXTRACT AU  ECX ECS SOURCE AUDIT     Event Capture
(ECS) Extract Audit
     3   EVENT CAPTURE DATA ENTRY  ECENTER     Event Capture Data Entry
     4   EVENT CAPTURE EXTRACT  ECXEC     Event Capture Extract
     5   EVENT CAPTURE MANAGEMENT MENU  ECMGR     Event Capture Management Menu
Press <Enter> to see more, '^' to exit this list,  OR
CHOOSE 1-5: 1  EVE     Systems Manager Menu


          Core Applications ...
          Device Management ...
          Menu Management ...
          Operations Management ...
          Spool Management ...
          Information Security Officer Menu ...
          Taskman Management ...
          User Management ...
   FM     VA FileMan ...
          Application Utilities ...
          Capacity Planning ...
          HL7 Main Menu ...
          Manage Mailman ...
          MAS Parameter Entry/Edit

Select Systems Manager Menu Option: PROG  ??


          Core Applications ...
          Device Management ...
          Menu Management ...
          Operations Management ...
          Spool Management ...
          Information Security Officer Menu ...
          Taskman Management ...
          User Management ...
   FM     VA FileMan ...
          Application Utilities ...
          Capacity Planning ...
          HL7 Main Menu ...
          Manage Mailman ...
          MAS Parameter Entry/Edit

Select Systems Manager Menu Option:

Do you really want to halt? YES//
























Logged out at Feb 20, 2011 5:08 pm
EHR:cassandra>W DUZ
23
EHR:cassandra>S DUZ=9

EHR:cassandra>D ^XUP

Setting up programmer environment
This is a TEST account.

Terminal Type set to: C-VT100

You have 36 new messages.
Select OPTION NAME: EVE
     1   EVE       Systems Manager Menu
     2   EVENT CAPTURE (ECS) EXTRACT AU  ECX ECS SOURCE AUDIT     Event Capture
(ECS) Extract Audit
     3   EVENT CAPTURE DATA ENTRY  ECENTER     Event Capture Data Entry
     4   EVENT CAPTURE EXTRACT  ECXEC     Event Capture Extract
     5   EVENT CAPTURE MANAGEMENT MENU  ECMGR     Event Capture Management Menu
Press <Enter> to see more, '^' to exit this list,  OR
CHOOSE 1-5: 1  EVE     Systems Manager Menu


          Core Applications ...
          Device Management ...
          Menu Management ...
          Programmer Options ...
          Operations Management ...
          Spool Management ...
          Information Security Officer Menu ...
          Taskman Management ...
          User Management ...
   FM     VA FileMan ...
          Application Utilities ...
          Capacity Planning ...
          HL7 Main Menu ...
          Manage Mailman ...
          MAS Parameter Entry/Edit

Select Systems Manager Menu Option: PROGrammer Options


   KIDS   Kernel Installation & Distribution System ...
   PG     Programmer mode
          Delete Unreferenced Options
          Error Processing ...
          Global Block Count
          Routine Tools ...

Select Programmer Options Option: ERROR Processing


   P1     Print 1 occurence of each error for T-1 (QUEUE)
   P2     Print 2 occurrences of errors on T-1 (QUEUED)
          Clean Error Trap
          Error Trap Display
          Interactive Print of Error Messages
          Remove a TYPE of error

Select Error Processing Option: ERROR TRAP Display

In response to the DATE prompt you can enter:
     'S' to specify text to be matched in error or routine name


No error logged on 2/20/2011

Which date? >


   P1     Print 1 occurence of each error for T-1 (QUEUE)
   P2     Print 2 occurrences of errors on T-1 (QUEUED)
          Clean Error Trap
          Error Trap Display
          Interactive Print of Error Messages
          Remove a TYPE of error

Select Error Processing Option:


   KIDS   Kernel Installation & Distribution System ...
   PG     Programmer mode
          Delete Unreferenced Options
          Error Processing ...
          Global Block Count
          Routine Tools ...

Select Programmer Options Option:


          Core Applications ...
          Device Management ...
          Menu Management ...
          Programmer Options ...
          Operations Management ...
          Spool Management ...
          Information Security Officer Menu ...
          Taskman Management ...
          User Management ...
   FM     VA FileMan ...
          Application Utilities ...
          Capacity Planning ...
          HL7 Main Menu ...
          Manage Mailman ...
          MAS Parameter Entry/Edit

Select Systems Manager Menu Option:

Do you really want to halt? YES//
























Logged out at Feb 20, 2011 5:08 pm
EHR:cassandra>ZSHOW
PR1+2^DIC11    (Direct mode)
PROMPT+1^DIC11
PROMPT+1^DIC1
ASK+3^DIC
XQ1+2^XQ1
ZIS2+8^XUP
+1^GTM$DMOD    (Direct mode)

EHR:cassandra>ZED "KBANSTAK"

EHR:cassandra>zl

EHR:cassandra>zp ^KBANSTAK
KBANSTAK ; UJO/SMH - Routine to demo the Stack and the New Command ; 2/20/11 5:1
0pm
 ;;
EN
 ;
 BREAK  ; Breaks gets you out of a routine and into debug mode

EHR:cassandra>D EN^KBANSTAK
%GTM-I-BREAK, Break instruction encountered
                At M source location EN+2^KBANSTAK

EHR:cassandra>ZSHOW
EN+2^KBANSTAK    (Direct mode)
PR1+2^DIC11    (Direct mode)
PROMPT+1^DIC11
PROMPT+1^DIC1
ASK+3^DIC
XQ1+2^XQ1
ZIS2+8^XUP
+1^GTM$DMOD    (Direct mode)

EHR:cassandra>ZGOTO

EHR:cassandra>ZSHOW
+1^GTM$DMOD    (Direct mode)

EHR:cassandra>; ZGOTO removes all stack levels and gives you a chance to start o
ver

EHR:cassandra>; Cache -> Zgoto doesn't exist; use QUIT

EHR:cassandra>; ZGOTO removes all stack levels and gives you a chance to start o
EHR:cassandra>D EN^KBANSTAK
%GTM-I-BREAK, Break instruction encountered
                At M source location EN+2^KBANSTAK

EHR:cassandra>zshow
EN+2^KBANSTAK    (Direct mode)
+1^GTM$DMOD    (Direct mode)

EHR:cassandra>W $STACK
1
EHR:cassandra>W $STACK(0,"PLACE")
+1^GTM$DMOD
EHR:cassandra>W $STACK(1,"PLACE")
EN+2^KBANSTAK
EHR:cassandra>W $STACK(2,"PLACE")

EHR:cassandra>W $STACK(2,"MCODE")

EHR:cassandra>W $STACK(1,"MCODE")
 BREAK  ; Breaks gets you out of a routine and into debug mode
EHR:cassandra>ZED

EHR:cassandra>zl
%GTM-E-LOADRUNNING, Cannot ZLINK an active routine KBANSTAK

EHR:cassandra>ZGOTO  ; CLEARS THE STACK

EHR:cassandra>ZLINK

EHR:cassandra>rec ZP

Recall Error : No matching string

EHR:cassandra>rec zp

EHR:cassandra>zp ^KBANSTAK
KBANSTAK ; UJO/SMH - Routine to demo the Stack and the New Command ; 2/20/11 5:1
5pm
 ;;
EN
 ;
 SET X=1
 IF X DO
 . WRITE "HELLO STACKS!",!
 . WRITE "I am at Stack Level: ",$STACK
 . BREAK  ; Breaks gets you out of a routine and into debug mode
 QUIT

EHR:cassandra>D EN^KBANSTAK
HELLO STACKS!
I am at Stack Level: 2%GTM-I-BREAK, Break instruction encountered
                At M source location EN+6^KBANSTAK

EHR:cassandra>ZED

EHR:cassandra>zgoto

EHR:cassandra>zlink

EHR:cassandra>rec zp

EHR:cassandra>zp ^KBANSTAK
KBANSTAK ; UJO/SMH - Routine to demo the Stack and the New Command ; 2/20/11 5:1
8pm
 ;;
EN
 ;
 WRITE "HELLO STACKS!",!
 WRITE "I am at Stack Level: ",$STACK
 SET X=1
 IF X DO
 . WRITE "I am at Stack Level: ",$STACK
 . BREAK  ; Breaks gets you out of a routine and into debug mode
 QUIT

EHR:cassandra>D EN^KBANSTAK
HELLO STACKS!
I am at Stack Level: 1I am at Stack Level: 2%GTM-I-BREAK, Break instruction encountered
                At M source location EN+7^KBANSTAK

EHR:cassandra>ZED "KBANSTAK"

EHR:cassandra>zl
%GTM-E-LOADRUNNING, Cannot ZLINK an active routine KBANSTAK

EHR:cassandra>zgoto

EHR:cassandra>zlink

EHR:cassandra>zp ^KBANSTAK
KBANSTAK ; UJO/SMH - Routine to demo the Stack and the New Command ; 2/20/11 5:3
3pm
 ;;
EN
 ;
 WRITE "HELLO STACKS!",!
 WRITE "I am at Stack Level: ",$STACK,!
 SET X=1
 IF X DO
 . WRITE "I am at Stack Level: ",$STACK,!
 . FOR I=1:1:2 DO
 . . WRITE "In For Loop ",I,"; Stack is ",$STACK,!
 S Y=$$RETURN5
 QUIT
RETURN5()
 WRITE "In $$; Stack level: ",$STACK,!
 QUIT 5

EHR:cassandra>D EN^KBANSTAK
HELLO STACKS!
I am at Stack Level: 1
I am at Stack Level: 2
In For Loop 1; Stack is 3
In For Loop 2; Stack is 3
In $$; Stack level: 2

EHR:cassandra>ZED

EHR:cassandra>zg

EHR:cassandra>zl

EHR:cassandra>rec rp

Recall Error : No matching string

EHR:cassandra>rec zp

EHR:cassandra>zp ^KBANSTAK
KBANSTAK ; UJO/SMH - Routine to demo the Stack and the New Command ; 2/20/11 5:3
7pm
 ;;
EN
 ;
 WRITE "HELLO STACKS!",!
 WRITE "I am at Stack Level: ",$STACK,!
 SET X=1
 IF X DO
 . WRITE "I am at Stack Level: ",$STACK,!
 . FOR I=1:1:2 DO
 . . WRITE "In For Loop ",I,"; Stack is ",$STACK,!
 . WRITE "I am at Stack Level",$STACK,!
 WRITE "I am at Stack Level",$STACK,!
 S Y=$$RETURN5
 QUIT
RETURN5()
 WRITE "In $$; Stack level: ",$STACK,!
 QUIT 5

EHR:cassandra>D EN^KBANSTAK
HELLO STACKS!
I am at Stack Level: 1
I am at Stack Level: 2
In For Loop 1; Stack is 3
In For Loop 2; Stack is 3
I am at Stack Level2
I am at Stack Level1
In $$; Stack level: 2

EHR:cassandra>D RETURN5^KBANSTAK
%GTM-E-ACTLSTEXP, Actuallist expected
                At M source location RETURN5^KBANSTAK

EHR:cassandra>D RETURN5^KBANSTAK()
In $$; Stack level: 2
%GTM-E-NOTEXTRINSIC, Quit does not return to an extrinsic function: argument not allowed
                At M source location RETURN5+2^KBANSTAK

EHR:cassandra>WRITE $$RETURN5^KBANSTAK()
In $$; Stack level: 3
5
EHR:cassandra>ZSHOW
RETURN5+2^KBANSTAK    ($ZTRAP)
    (Direct mode)
RETURN5^KBANSTAK    ($ZTRAP)
    (Direct mode)
+1^GTM$DMOD    (Direct mode)

EHR:cassandra>ZGOTO

EHR:cassandra>ZSHOW
+1^GTM$DMOD    (Direct mode)

EHR:cassandra>WRITE $$RETURN5^KBANSTAK()
In $$; Stack level: 1
5
EHR:cassandra>W $STACK
0
EHR:cassandra>D ^XUP

Setting up programmer environment
This is a TEST account.

Terminal Type set to: C-VT100

You have 36 new messages.
Select OPTION NAME:
%GTM-I-CTRLC, CTRL_C encountered

EHR:cassandra>ZSHOW
PR1+2^DIC11    (Direct mode)
PROMPT+1^DIC11
PROMPT+1^DIC1
ASK+3^DIC
XQ1+2^XQ1
ZIS2+8^XUP
+1^GTM$DMOD    (Direct mode)

EHR:cassandra>ZGOTO 1

EHR:cassandra>ZSHOW
+1^GTM$DMOD    (Direct mode)

EHR:cassandra>ZED

EHR:cassandra>; New command

EHR:cassandra>; 1990 Standard of Mumps

EHR:cassandra>zed "PSOSTART"

EHR:cassandra>zed "KBANSTAK"

EHR:cassandra>ZWRITE
DIC="^DIC(19,"
DIC(0)="AEQM"
DIC("W")="N C,DINAME W ""  "" W:$D(^(""0"")) ""   "",$P(^(""0""),U,2)"
DILOCKTM=3
DISYS=19
DT=3110220
DTIME=9999
DUZ=9
DUZ(0)="@"
DUZ(1)=""
DUZ(2)=67
DUZ("AG")="E"
DUZ("AUTO")=1
DUZ("BUF")=1
DUZ("LANG")=""
IO="/dev/pts/0"
IO(0)="/dev/pts/0"
IO(1,"/dev/pts/0")=""
IO("ERROR")=""
IO("HOME")="50^/dev/pts/0"
IO("ZIO")="/dev/pts/0"
IOBS="$C(8)"
IOF="#,$C(27,91,50,74,27,91,72)"
IOM=80
ION="TELNET"
IOS=50
IOSL=24
IOST="C-VT100"
IOST(0)=9
IOT="VTRM"
IOXY="W $C(27,91)_((DY+1))_$C(59)_((DX+1))_$C(72)"
U="^"
XQDIC=9
XQPSM="P9"
XQVOL="EHR"
XQXFLG="^^XUP"
Y=-1

EHR:cassandra>; Symbol Table

EHR:cassandra>; Local variables defined in a Mumps Process

EHR:cassandra>; To create a variable, just set it.

EHR:cassandra>; To clear the symbol table, use 'KILL' with no arguments

EHR:cassandra>KILL

EHR:cassandra>ZWRITE

EHR:cassandra>ZP ^KBANSTAK
KBANSTAK ; UJO/SMH - Routine to demo the Stack and the New Command ; 2/20/11 5:3
7pm
 ;;
EN
 ;
 WRITE "HELLO STACKS!",!
 WRITE "I am at Stack Level: ",$STACK,!
 SET X=1
 IF X DO
 . WRITE "I am at Stack Level: ",$STACK,!
 . FOR I=1:1:2 DO
 . . WRITE "In For Loop ",I,"; Stack is ",$STACK,!
 . WRITE "I am at Stack Level",$STACK,!
 WRITE "I am at Stack Level",$STACK,!
 S Y=$$RETURN5
 QUIT
RETURN5()
 WRITE "In $$; Stack level: ",$STACK,!
 QUIT 5

EHR:cassandra>D ^KBANSTAK
HELLO STACKS!
I am at Stack Level: 1
I am at Stack Level: 2
In For Loop 1; Stack is 3
In For Loop 2; Stack is 3
I am at Stack Level2
I am at Stack Level1
In $$; Stack level: 2

EHR:cassandra>ZWRITE
I=2
X=1
Y=5

EHR:cassandra>ZED "DIC"

EHR:cassandra>zed

EHR:cassandra>zed "KBANSTAK"

EHR:cassandra>zl

EHR:cassandra>ZP ^KBANSTAK
KBANSTAK ; UJO/SMH - Routine to demo the Stack and the New Command ; 2/20/11 5:5
8pm
 ;;
EN
 ;
 WRITE "HELLO STACKS!",!
 WRITE "I am at Stack Level: ",$STACK,!
 NEW X
 SET X=1
 IF X DO
 . WRITE "I am at Stack Level: ",$STACK,!
 . FOR I=1:1:2 DO
 . . WRITE "In For Loop ",I,"; Stack is ",$STACK,!
 . WRITE "I am at Stack Level",$STACK,!
 WRITE "I am at Stack Level",$STACK,!
 S Y=$$RETURN5
 QUIT
RETURN5()
 WRITE "In $$; Stack level: ",$STACK,!
 QUIT 5

EHR:cassandra>kill

EHR:cassandra>D ^KBANSTAK
HELLO STACKS!
I am at Stack Level: 1
I am at Stack Level: 2
In For Loop 1; Stack is 3
In For Loop 2; Stack is 3
I am at Stack Level2
I am at Stack Level1
In $$; Stack level: 2

EHR:cassandra>zwrite
I=2
Y=5

EHR:cassandra>ZED

EHR:cassandra>zl

EHR:cassandra>zp ^KBANSTACK
%GTM-E-ZLINKFILE, Error while zlinking "KBANSTACK"
%GTM-E-FILENOTFND, File KBANSTACK not found

EHR:cassandra>zp ^KBANSTAK
KBANSTAK ; UJO/SMH - Routine to demo the Stack and the New Command ; 2/20/11 6:0
0pm
 ;;
EN
 ;
 WRITE "HELLO STACKS!",!
 WRITE "I am at Stack Level: ",$STACK,!
 NEW X
 SET X=1
 WRITE "X is ",X,!
 IF X DO
 . WRITE "I am at Stack Level: ",$STACK,!
 . NEW X
 . WRITE X
 . FOR I=1:1:2 DO
 . . WRITE "In For Loop ",I,"; Stack is ",$STACK,!
 . WRITE "I am at Stack Level",$STACK,!
 WRITE "I am at Stack Level",$STACK,!
 S Y=$$RETURN5
 QUIT
RETURN5()
 WRITE "In $$; Stack level: ",$STACK,!
 QUIT 5

EHR:cassandra>D ^KBANSTAK
HELLO STACKS!
I am at Stack Level: 1
X is 1
I am at Stack Level: 2
%GTM-E-UNDEF, Undefined local variable: X
                At M source location EN+10^KBANSTAK

EHR:cassandra>ZGOTO

EHR:cassandra>ZED

EHR:cassandra>zl

EHR:cassandra>rec zp

EHR:cassandra>zp ^KBANSTAK
KBANSTAK ; UJO/SMH - Routine to demo the Stack and the New Command ; 2/20/11 6:0
1pm
 ;;
EN
 ;
 WRITE "HELLO STACKS!",!
 WRITE "I am at Stack Level: ",$STACK,!
 NEW X
 SET X=1
 WRITE "X is ",X,!
 IF X DO
 . WRITE "I am at Stack Level: ",$STACK,!
 . WRITE X
 . FOR I=1:1:2 DO
 . . WRITE "In For Loop ",I,"; Stack is ",$STACK,!
 . WRITE "I am at Stack Level",$STACK,!
 WRITE "I am at Stack Level",$STACK,!
 S Y=$$RETURN5
 QUIT
RETURN5()
 WRITE "In $$; Stack level: ",$STACK,!
 QUIT 5

EHR:cassandra>D ^KBANSTAK
HELLO STACKS!
I am at Stack Level: 1
X is 1
I am at Stack Level: 2
1In For Loop 1; Stack is 3
In For Loop 2; Stack is 3
I am at Stack Level2
I am at Stack Level1
In $$; Stack level: 2

EHR:cassandra>ZED

EHR:cassandra>zl

EHR:cassandra>D ^KBANSTAK
HELLO STACKS!
I am at Stack Level: 1
X is 1
I am at Stack Level: 2
X is 1
In For Loop 1; Stack is 3
In For Loop 2; Stack is 3
I am at Stack Level2
I am at Stack Level1
In $$; Stack level: 2

EHR:cassandra>zed

EHR:cassandra>zl

EHR:cassandra>zp ^KBANSTAK
KBANSTAK ; UJO/SMH - Routine to demo the Stack and the New Command ; 2/20/11 6:0
4pm
 ;;
EN
 ;
 WRITE "HELLO STACKS!",!
 WRITE "I am at Stack Level: ",$STACK,!
 NEW X
 SET X=1
 WRITE "X is ",X,!
 IF X DO
 . WRITE "I am at Stack Level: ",$STACK,!
 . NEW X  ; Shadows original X variable
 . SET X="NEW"
 . WRITE "X is ",X,!
 . FOR I=1:1:2 DO
 . . WRITE "In For Loop ",I,"; Stack is ",$STACK,!
 . WRITE "I am at Stack Level",$STACK,!
 WRITE "I am at Stack Level",$STACK,!
 WRITE "X is ",X,!
 S Y=$$RETURN5
 QUIT
RETURN5()
 WRITE "In $$; Stack level: ",$STACK,!
 QUIT 5

EHR:cassandra>ZL

EHR:cassandra>ZGOTO

EHR:cassandra>K

EHR:cassandra>D ^KBANSTAK
HELLO STACKS!
I am at Stack Level: 1
X is 1
I am at Stack Level: 2
X is NEW
In For Loop 1; Stack is 3
In For Loop 2; Stack is 3
I am at Stack Level2
I am at Stack Level1
X is 1
In $$; Stack level: 2

EHR:cassandra>ZED

EHR:cassandra>zl

EHR:cassandra>rec zp

EHR:cassandra>zp ^KBANSTAK
KBANSTAK ; UJO/SMH - Routine to demo the Stack and the New Command ; 2/20/11 6:0
6pm
 ;;
EN
 ;
 WRITE "HELLO STACKS!",!
 WRITE "I am at Stack Level: ",$STACK,!
 NEW X
 SET X=1
 WRITE "X is ",X,!
 IF X DO
 . WRITE "I am at Stack Level: ",$STACK,!
 . ; NEW X  ; Shadows original X variable
 . SET X="NEW"
 . WRITE "X is ",X,!
 . FOR I=1:1:2 DO
 . . WRITE "In For Loop ",I,"; Stack is ",$STACK,!
 . WRITE "I am at Stack Level",$STACK,!
 WRITE "I am at Stack Level",$STACK,!
 WRITE "X is ",X,!
 S Y=$$RETURN5
 QUIT
RETURN5()
 WRITE "In $$; Stack level: ",$STACK,!
 QUIT 5

EHR:cassandra>D ^KBANSTAK
HELLO STACKS!
I am at Stack Level: 1
X is 1
I am at Stack Level: 2
X is NEW
In For Loop 1; Stack is 3
In For Loop 2; Stack is 3
I am at Stack Level2
I am at Stack Level1
X is NEW
In $$; Stack level: 2

EHR:cassandra>zwrite
I=2
Y=5

EHR:cassandra>zed

EHR:cassandra>zl

EHR:cassandra>zp ^KBANSTAK
KBANSTAK ; UJO/SMH - Routine to demo the Stack and the New Command ; 2/20/11 6:0
8pm
 ;;
EN
 ;
 WRITE "HELLO STACKS!",!
 WRITE "I am at Stack Level: ",$STACK,!
 NEW X
 SET X=1
 WRITE "X is ",X,!
 IF X DO
 . WRITE "I am at Stack Level: ",$STACK,!
 . NEW X  ; Shadows original X variable
 . SET X="NEW"
 . BREAK
 . WRITE "X is ",X,!
 . FOR I=1:1:2 DO
 . . WRITE "In For Loop ",I,"; Stack is ",$STACK,!
 . WRITE "I am at Stack Level",$STACK,!
 WRITE "I am at Stack Level",$STACK,!
 WRITE "X is ",X,!
 BREAK
 S Y=$$RETURN5
 QUIT
RETURN5()
 WRITE "In $$; Stack level: ",$STACK,!
 QUIT 5

EHR:cassandra>D ^KBANSTAK
HELLO STACKS!
I am at Stack Level: 1
X is 1
I am at Stack Level: 2
%GTM-I-BREAK, Break instruction encountered
                At M source location EN+11^KBANSTAK

EHR:cassandra>ZSHOW
EN+11^KBANSTAK    (Direct mode)
EN+7^KBANSTAK
+1^GTM$DMOD    (Direct mode)

EHR:cassandra>ZWRITE
I=2
X="NEW"
Y=5

EHR:cassandra>ZCONTINUE
X is NEW
In For Loop 1; Stack is 3
In For Loop 2; Stack is 3
I am at Stack Level2
I am at Stack Level1
X is 1
%GTM-I-BREAK, Break instruction encountered
                At M source location EN+18^KBANSTAK

EHR:cassandra>ZWRITE
I=2
X=1
Y=5

EHR:cassandra>ZSH
EN+18^KBANSTAK    (Direct mode)
+1^GTM$DMOD    (Direct mode)

EHR:cassandra>ZCONTINUE
In $$; Stack level: 2

EHR:cassandra>ZSH
+1^GTM$DMOD    (Direct mode)

EHR:cassandra>ZWRITE
I=2
Y=5

EHR:cassandra>ZED "XMRPOP
%GTM-E-SPOREOL, Either a space or an end-of-line was expected but not found
        ZED "XMRPOP
                   ^-----

EHR:cassandra>ZED "XMRPOP"

EHR:cassandra>D ^XUP

Setting up programmer environment
This is a TEST account.

Access Code: *********
Terminal Type set to: C-VT100

Select OPTION NAME:
EHR:cassandra>ZWRITE
DILOCKTM=3
DISYS=19
DT=3110220
DTIME=9999
DUZ=23
DUZ(0)="#"
DUZ(1)=""
DUZ(2)=67
DUZ("AG")="E"
DUZ("BUF")=1
DUZ("LANG")=""
IO="/dev/pts/0"
IO(0)="/dev/pts/0"
IO(1,"/dev/pts/0")=""
IO("ERROR")=""
IO("HOME")="50^/dev/pts/0"
IO("ZIO")="/dev/pts/0"
IOBS="$C(8)"
IOF="#,$C(27,91,50,74,27,91,72)"
IOM=80
ION="TELNET"
IOS=50
IOSL=24
IOST="C-VT100"
IOST(0)=9
IOT="VTRM"
IOXY="W $C(27,91)_((DY+1))_$C(59)_((DX+1))_$C(72)"
U="^"
X="20;DIC(4.2,"
XPARSYS="20;DIC(4.2,"
XQXFLG="^^XUP"

EHR:cassandra>ZED "XMRPOP"

EHR:cassandra>

EHR:cassandra>