KLASSTU1 ; DIRECT KEYBOARD INPUT TO GLOBAL (FOR TAPE) ;DEC 18,1990@13:54:58
;;1.0
ST S M=LIMIT,TC="",TMC="X ^%ZOSF(""TRMRD"")",C=KLSTMC,CC=$C(CTRL),X=240 X ^%ZOSF("RM"),^("EON"),^("TRMON")
U IO(0) W !,"Entering Direct Mode",!
K DIC,DIE S DIE="^KLAS(1200,JOB,""M"",",DA(1)=JOB,DA=STUDA,DR="1///"_"BDIRECT" D ^DIE
CON W !,"Enter CTRL-",$C(CTRL+64)," twice to Exit Direct Mode",!
RD W TC,*17 R X#200:1 X TMC W *19 S X=TC_X,TC="" I $T G:Y=CTRL QRD S TC=$C(Y)
G:$D(^KLAS(1200,JOB,"M",STUDA,"AMSG")) QRD1
I $L(X) S:C=M C=0 S C=C+1,^KLAS(1200,JOB,"R",C,0)=X,^KLAS(1200,JOB,"R1")=C,KLSTMC=C G RD
G RD
QRD W *17,*7 R X#1:8 X TMC W *19 I $T G:Y=CTRL QRD1 S TC=$C(CTRL)_X G RD
I X=CC G QRD1
G RD
QRD1 S KLSTMC=C,X=0 X ^%ZOSF("RM"),^("EOFF") U IO(0) W !,"Ending Direct Mode",! U IO(0) W *17
K DIE,DIC S DIE="^KLAS(1200,JOB,""M"",",DA=STUDA,DA(1)=JOB,DR="1///"_"EDIRECT" D ^DIE K DIE,DR,DA
S (KLMCNT,KLWCNT)=^KLAS(1200,JOB,"P1")
Q
VIEW ;
R *X:3 D:X=39 XRAY^KLASMAN Q:X'=42 W ! S KLNS=0 F KLNSC=1:1 S KLNS=$O(^KLAS(1200,JOB,"M",KLNS)) Q:+KLNS'>0 D PSTU
R !!,"<CR> TO CONTINUE ",X:10 W ! Q
PSTU F KLZZ=4:1:6 S KLZZ(KLZZ)=$P(^KLAS(1200,JOB,"M",KLNS,0),U,KLZZ)
S Y=KLZZ(4) X ^DD("DD") W !,KLNSC,?5,$P(^KLAS(1200,JOB,"M",KLNS,0),"^"),?20,Y,?30," PORT: ",KLZZ(5)," JOB/PID: ",KLZZ(6) K KLZZ,Y
Q
PURGE I ^KLAS(1200,JOB,"P3")'="PURGE" G STOP^KLASSTU
F I=1:1:20 W *7
R !,"Please enter a Carriage Return to show you are ALIVE !! (you have 60 seconds) ",X:60 G:$T=0&(X="") STOP^KLASSTU
W !,"Glad you are still with us !!",!
S DIC(0)="QMLZ",DIC="^KLAS(1200,"_JOB_",""M"",",X=NAME_" "_STUDA_" "_IO_" "_$J,DA(1)=JOB,DINUM=STUDA,DIC("DR")="1///"_NAME_" HAS JOINED" D FILE^DICN
H 3 G LOOP^KLASSTU
Q ;---------------------------------------------
KLASSTU1 ; DIRECT KEYBOARD INPUT TO GLOBAL (FOR TAPE) ;DEC 18,1990@13:54:58
+1 ;;1.0
ST SET M=LIMIT
SET TC=""
SET TMC="X ^%ZOSF(""TRMRD"")"
SET C=KLSTMC
SET CC=$CHAR(CTRL)
SET X=240
XECUTE ^%ZOSF("RM")
XECUTE ^("EON")
XECUTE ^("TRMON")
+1 USE IO(0)
WRITE !,"Entering Direct Mode",!
+2 KILL DIC,DIE
SET DIE="^KLAS(1200,JOB,""M"","
SET DA(1)=JOB
SET DA=STUDA
SET DR="1///"_"BDIRECT"
DO ^DIE
CON WRITE !,"Enter CTRL-",$CHAR(CTRL+64)," twice to Exit Direct Mode",!
RD WRITE TC,*17
READ X#200:1
XECUTE TMC
WRITE *19
SET X=TC_X
SET TC=""
IF $TEST
IF Y=CTRL
GOTO QRD
SET TC=$CHAR(Y)
+1 IF $DATA(^KLAS(1200,JOB,"M",STUDA,"AMSG"))
GOTO QRD1
+2 IF $LENGTH(X)
IF C=M
SET C=0
SET C=C+1
SET ^KLAS(1200,JOB,"R",C,0)=X
SET ^KLAS(1200,JOB,"R1")=C
SET KLSTMC=C
GOTO RD
+3 GOTO RD
QRD WRITE *17,*7
READ X#1:8
XECUTE TMC
WRITE *19
IF $TEST
IF Y=CTRL
GOTO QRD1
SET TC=$CHAR(CTRL)_X
GOTO RD
+1 IF X=CC
GOTO QRD1
+2 GOTO RD
QRD1 SET KLSTMC=C
SET X=0
XECUTE ^%ZOSF("RM")
XECUTE ^("EOFF")
USE IO(0)
WRITE !,"Ending Direct Mode",!
USE IO(0)
WRITE *17
+1 KILL DIE,DIC
SET DIE="^KLAS(1200,JOB,""M"","
SET DA=STUDA
SET DA(1)=JOB
SET DR="1///"_"EDIRECT"
DO ^DIE
KILL DIE,DR,DA
+2 SET (KLMCNT,KLWCNT)=^KLAS(1200,JOB,"P1")
+3 QUIT
VIEW ;
+1 READ *X:3
IF X=39
DO XRAY^KLASMAN
IF X'=42
QUIT
WRITE !
SET KLNS=0
FOR KLNSC=1:1
SET KLNS=$ORDER(^KLAS(1200,JOB,"M",KLNS))
IF +KLNS'>0
QUIT
DO PSTU
+2 READ !!,"<CR> TO CONTINUE ",X:10
WRITE !
QUIT
PSTU FOR KLZZ=4:1:6
SET KLZZ(KLZZ)=$PIECE(^KLAS(1200,JOB,"M",KLNS,0),U,KLZZ)
+1 SET Y=KLZZ(4)
XECUTE ^DD("DD")
WRITE !,KLNSC,?5,$PIECE(^KLAS(1200,JOB,"M",KLNS,0),"^"),?20,Y,?30," PORT: ",KLZZ(5)," JOB/PID: ",KLZZ(6)
KILL KLZZ,Y
+2 QUIT
PURGE IF ^KLAS(1200,JOB,"P3")'="PURGE"
GOTO STOP^KLASSTU
+1 FOR I=1:1:20
WRITE *7
+2 READ !,"Please enter a Carriage Return to show you are ALIVE !! (you have 60 seconds) ",X:60
IF $TEST=0&(X="")
GOTO STOP^KLASSTU
+3 WRITE !,"Glad you are still with us !!",!
+4 SET DIC(0)="QMLZ"
SET DIC="^KLAS(1200,"_JOB_",""M"","
SET X=NAME_" "_STUDA_" "_IO_" "_$JOB
SET DA(1)=JOB
SET DINUM=STUDA
SET DIC("DR")="1///"_NAME_" HAS JOINED"
DO FILE^DICN
+5 HANG 3
GOTO LOOP^KLASSTU
+6 ;---------------------------------------------
QUIT