KLASMAN0 ; GRLISC/PDW CALLED ROUTINE FOR CLASSMAN ;12/19/90 [ 07/27/93 2:56 PM ]
;;1.0
CTRL ; INTERPRET SPECIAL INSTRUCTIONS
S JMP="" S:'$D(EON) EON=^%ZOSF("EON") S:'$D(EOFF) EOFF=^%ZOSF("EOFF")
U IO(0) X ^%ZOSF("UCI") W !,Y,!,">>COMMAND MODE<<-------",!," |CTRL-",$C(64+CTRL),"| " R *Z:20 W:Z>-1 "| ",$C(Z)," |" X EOFF I Z=-1
I Z=94 S JMP="EXIT" Q ;"^"
I Z=63 W !,"REVIEW",! D REVIEW Q ;"?"
;I Z=46 S KXON=KXON+1#2 W:KXON !,"XON ",! W:'KXON !,"XOFF",! W ">>>ON LINE MODE<<<-------",! U IO W *17 U IO(0) Q
I Z=35 X TERMNORM R !,"Enter the new command character ? ",*X:30 Q:X="" S X=X#32 S CTRL=X W !,"COMMAND CHARACTER IS NOW >>CTRL-",$C(64+CTRL),"<<",!,">>ON LINE MODE<<-------",! S CC=$C(CTRL) Q ;"#"
I Z=38 X TERMNORM D PICKUP Q ;"&"
I Z=124 D ^KLASKERM Q ;kermit handling "|"
I Z=96 D XRAY^KLASDIA Q ;"`"
I Z=43 D DIRECT^KLASMAN1 Q ;"+"
I Z=37 W !! X TERMNORM,^%ZOSF("SS") H 2 W !,">>>ON LINE MODE<<<-------",! Q ;"%"
;I Z=33 X "NEW (EON,EOFF)" X EON D ^%RJD X EOFF W !,">>>ON LINE MODE<<<------" Q ;"!"
I Z=64 D PURGE S ^KLAS(1200,JOB,"P3")="PURGE" W !,"PURGE MESSAGE SENT",! H 2 K ^("P3") W !,">>>ON LINE MODE<<<-------",! Q ;"@"
I Z=61 W !,"PORT",! X TERMNORM D PORT Q ;"="
I Z=48 S Z0=0 W !,"BROADCAST TURNED OFF",!,"------->>ON-LINE MODE<<",! Q ;"0"
I Z=49 S Z0=1 W !,"BROADCAST TURNED ON",!,"------->>ON-LINE MODE<<",! Q ;"1"
I Z=42 X TERMNORM W !,"COMNEW",! D COMNEW Q ;"*"
I Z=36 X TERMNORM D ^KLASMAN2 Q ;"$"
I (Z<64)!(Z>122) W ?10," NO ACTION",!,"------->>ON-LINE MODE<<",! Q
W " ^",$C(Z),!,"------->>ON-LINE MODE<<",! S Z=Z#32
I Z=3 U IO W $C(3),*13 S Z="" Q
S Z=$C(Z) U IO W Z S Z="" Q
;---------------------------------------------------------------------------
PORT D PORT^KLASMAN3 Q ;"$"
;
REVIEW D DOC^KLASMAN3 S JMP="" Q
COMNEW ;CHANGE COMMAND OF THE PROGRAM WITH ONE OF THE STUDENTS
S DIC="^KLAS(1200,JOB,""M"",",DIC(0)="EQ",X="??"
S DIC("W")="S YY=Y,XX=""F ZZ=4:1:6 S ZZ(ZZ)=$P(^(0),U,ZZ)"" X XX S Y=ZZ(4) X ^DD(""DD"") W "" "",Y,"" PORT: "",ZZ(5),"" JOB/PID: "",ZZ(6) S Y=YY K YY,ZZ,XX"
D ^DIC S DIC(0)="AEQ" D ^DIC I +Y<0 W !,"------->>ON-LINE MODE<<",! X ^%ZOSF("EOFF") Q
S COM=1,STU=+Y,STUDIR=0,TL1=TL,DIE=DIC,DA(1)=JOB,DA=+Y,DR="2///"_"GRAB"_";2///@" D ^DIE K DIE,DIC,DR,DA
S ^KLAS(1200,JOB,"R1")=0 W !,"YOU MAY REGAIN COMMAND WITH <CR>",!,"------->>ON-LINE MODE<<",! X ^%ZOSF("EOFF") Q
COMOLD ; RETURN COMMAND TO INSTRUCTOR
S DIE="^KLAS(1200,"_JOB_",""M"",",COM=0,(WCOUNT,RCOUNT)=0,DA(1)=JOB,DA=STU,DR="2///"_"RELEASE"_";2///@" D ^DIE K ^KLAS(1200,JOB,"R") S STUDIR=0
Q
PURGE ;
S DIE="^KLAS(1200,"_JOB_",""M"",",DR=".01///@" F CC=1:1 S DA=$O(^KLAS(1200,JOB,"M",0)),DA(1)=JOB Q:DA="" D ^DIE
K DA,DIE,DR,CC Q
EXIT S %=1 U IO(0) W !,"DID YOU PROPERLY EXIT FROM THE APPLICATION ?" D YN^DICN G:%="^" EXIT I %=2 U IO(0) W ! S J="" G CON^KLASMAN
EXIT1 D:SCREEN CLOSE^KLASMAN2
I IO'=KPORT W !,"YOU MUST FIRST RETURN TO YOUR ORIGINAL PORT ",KNAM,! Q
CLEAN I $D(CLNUM) S DIE="^KLAS(1200.4,",DA=CLNUM,DR="3///NOW" D ^DIE
CLEANP S ^KLAS(1200,JOB,"P3")=0 W !,"CLEARING APPLICATION AND USERS",! X "F X=1:1:5 H 1 W "".""" S DA=JOB,DIK="^KLAS(1200," D ^DIK K DIK
EXIT3 X ^%ZIS("C") K K,X1,T1,T2,P1,Z0,P2,X2,L,Z,X3,J,L3,L1,L2,X,BCS,BT,CR,GLOB,J,I,POP,SCREEN,SLCOUNT,SLINE,TB,TN,Y,IOTEMP,CLNUM,INSTRUCT,CLASS,SCOUNT,WCOUNT,LIMIT,SESSION,KNAM,KPORT,KNUM,%,RCOUNT,COM,DIC,DIE,DR,IOP,STU,FRNAME,ZB
K %X,%Y,B,C,CTRL,END,EOFF,EON,FR,JOB,KLW,KXON,M,N1,N2,NFR,NULL,OPEX,START,SLDIC,STUDIR,TCK,TCP,TK,TL,TL1,TMC,TP,TT,TYP,ZE,TERMNORM,TERMKLAS
U 0 S X=IOM X ^%ZOSF("RM"),^%ZOSF("TRMOFF"),^%ZOSF("EON")
U 0:(0:::::#800001)
Q
;
PICKUP ; PICKUP CONTROL OF ANOTHER CLASS
X ^%ZOSF("EON") S DIC="^KLAS(1200,",DIC(0)="AEQMZ",DIC("S")="I JOB'=+Y" D ^DIC G:Y'>0 EPICK
YN1 W !,"Are You sure you want to become >>> ",Y(0,0),"<<<",!,"and the other job has been killed? Y/N "
S %=1 D YN^DICN G EPICK:%=-1!(%=2) I %=0 W !,"MAKE UP YOUR MIND",! G YN1
S NJOB=+Y
S ^KLAS(1200,JOB,"P3")=0 W !,"CLEARING MOST RECENT START UP AND ANY USERS",! X "F X=1:1:5 H 1 W "".""" S DA=JOB,DIK="^KLAS(1200," D ^DIK K DIK
S JOB=NJOB,SCOUNT=^KLAS(1200,JOB,"P1") K DIC,NJOB
EPICK W !,"----->ON LINE MODE<",! X ^%ZOSF("EOFF") K DIC,Y Q
CON G CON^KLASMAN
KLASMAN0 ; GRLISC/PDW CALLED ROUTINE FOR CLASSMAN ;12/19/90 [ 07/27/93 2:56 PM ]
+1 ;;1.0
CTRL ; INTERPRET SPECIAL INSTRUCTIONS
+1 SET JMP=""
IF '$DATA(EON)
SET EON=^%ZOSF("EON")
IF '$DATA(EOFF)
SET EOFF=^%ZOSF("EOFF")
+2 USE IO(0)
XECUTE ^%ZOSF("UCI")
WRITE !,Y,!,">>COMMAND MODE<<-------",!," |CTRL-",$CHAR(64+CTRL),"| "
READ *Z:20
IF Z>-1
WRITE "| ",$CHAR(Z)," |"
XECUTE EOFF
IF Z=-1
+3 ;"^"
IF Z=94
SET JMP="EXIT"
QUIT
+4 ;"?"
IF Z=63
WRITE !,"REVIEW",!
DO REVIEW
QUIT
+5 ;I Z=46 S KXON=KXON+1#2 W:KXON !,"XON ",! W:'KXON !,"XOFF",! W ">>>ON LINE MODE<<<-------",! U IO W *17 U IO(0) Q
+6 ;"#"
IF Z=35
XECUTE TERMNORM
READ !,"Enter the new command character ? ",*X:30
IF X=""
QUIT
SET X=X#32
SET CTRL=X
WRITE !,"COMMAND CHARACTER IS NOW >>CTRL-",$CHAR(64+CTRL),"<<",!,">>ON LINE MODE<<-------",!
SET CC=$CHAR(CTRL)
QUIT
+7 ;"&"
IF Z=38
XECUTE TERMNORM
DO PICKUP
QUIT
+8 ;kermit handling "|"
IF Z=124
DO ^KLASKERM
QUIT
+9 ;"`"
IF Z=96
DO XRAY^KLASDIA
QUIT
+10 ;"+"
IF Z=43
DO DIRECT^KLASMAN1
QUIT
+11 ;"%"
IF Z=37
WRITE !!
XECUTE TERMNORM
XECUTE ^%ZOSF("SS")
HANG 2
WRITE !,">>>ON LINE MODE<<<-------",!
QUIT
+12 ;I Z=33 X "NEW (EON,EOFF)" X EON D ^%RJD X EOFF W !,">>>ON LINE MODE<<<------" Q ;"!"
+13 ;"@"
IF Z=64
DO PURGE
SET ^KLAS(1200,JOB,"P3")="PURGE"
WRITE !,"PURGE MESSAGE SENT",!
HANG 2
KILL ^("P3")
WRITE !,">>>ON LINE MODE<<<-------",!
QUIT
+14 ;"="
IF Z=61
WRITE !,"PORT",!
XECUTE TERMNORM
DO PORT
QUIT
+15 ;"0"
IF Z=48
SET Z0=0
WRITE !,"BROADCAST TURNED OFF",!,"------->>ON-LINE MODE<<",!
QUIT
+16 ;"1"
IF Z=49
SET Z0=1
WRITE !,"BROADCAST TURNED ON",!,"------->>ON-LINE MODE<<",!
QUIT
+17 ;"*"
IF Z=42
XECUTE TERMNORM
WRITE !,"COMNEW",!
DO COMNEW
QUIT
+18 ;"$"
IF Z=36
XECUTE TERMNORM
DO ^KLASMAN2
QUIT
+19 IF (Z<64)!(Z>122)
WRITE ?10," NO ACTION",!,"------->>ON-LINE MODE<<",!
QUIT
+20 WRITE " ^",$CHAR(Z),!,"------->>ON-LINE MODE<<",!
SET Z=Z#32
+21 IF Z=3
USE IO
WRITE $CHAR(3),*13
SET Z=""
QUIT
+22 SET Z=$CHAR(Z)
USE IO
WRITE Z
SET Z=""
QUIT
+23 ;---------------------------------------------------------------------------
PORT ;"$"
DO PORT^KLASMAN3
QUIT
+1 ;
REVIEW DO DOC^KLASMAN3
SET JMP=""
QUIT
COMNEW ;CHANGE COMMAND OF THE PROGRAM WITH ONE OF THE STUDENTS
+1 SET DIC="^KLAS(1200,JOB,""M"","
SET DIC(0)="EQ"
SET X="??"
+2 SET DIC("W")="S YY=Y,XX=""F ZZ=4:1:6 S ZZ(ZZ)=$P(^(0),U,ZZ)"" X XX S Y=ZZ(4) X ^DD(""DD"") W "" "",Y,"" PORT: "",ZZ(5),"" JOB/PID: "",ZZ(6) S Y=YY K YY,ZZ,XX"
+3 DO ^DIC
SET DIC(0)="AEQ"
DO ^DIC
IF +Y<0
WRITE !,"------->>ON-LINE MODE<<",!
XECUTE ^%ZOSF("EOFF")
QUIT
+4 SET COM=1
SET STU=+Y
SET STUDIR=0
SET TL1=TL
SET DIE=DIC
SET DA(1)=JOB
SET DA=+Y
SET DR="2///"_"GRAB"_";2///@"
DO ^DIE
KILL DIE,DIC,DR,DA
+5 SET ^KLAS(1200,JOB,"R1")=0
WRITE !,"YOU MAY REGAIN COMMAND WITH <CR>",!,"------->>ON-LINE MODE<<",!
XECUTE ^%ZOSF("EOFF")
QUIT
COMOLD ; RETURN COMMAND TO INSTRUCTOR
+1 SET DIE="^KLAS(1200,"_JOB_",""M"","
SET COM=0
SET (WCOUNT,RCOUNT)=0
SET DA(1)=JOB
SET DA=STU
SET DR="2///"_"RELEASE"_";2///@"
DO ^DIE
KILL ^KLAS(1200,JOB,"R")
SET STUDIR=0
+2 QUIT
PURGE ;
+1 SET DIE="^KLAS(1200,"_JOB_",""M"","
SET DR=".01///@"
FOR CC=1:1
SET DA=$ORDER(^KLAS(1200,JOB,"M",0))
SET DA(1)=JOB
IF DA=""
QUIT
DO ^DIE
+2 KILL DA,DIE,DR,CC
QUIT
EXIT SET %=1
USE IO(0)
WRITE !,"DID YOU PROPERLY EXIT FROM THE APPLICATION ?"
DO YN^DICN
IF %="^"
GOTO EXIT
IF %=2
USE IO(0)
WRITE !
SET J=""
GOTO CON^KLASMAN
EXIT1 IF SCREEN
DO CLOSE^KLASMAN2
+1 IF IO'=KPORT
WRITE !,"YOU MUST FIRST RETURN TO YOUR ORIGINAL PORT ",KNAM,!
QUIT
CLEAN IF $DATA(CLNUM)
SET DIE="^KLAS(1200.4,"
SET DA=CLNUM
SET DR="3///NOW"
DO ^DIE
CLEANP SET ^KLAS(1200,JOB,"P3")=0
WRITE !,"CLEARING APPLICATION AND USERS",!
XECUTE "F X=1:1:5 H 1 W ""."""
SET DA=JOB
SET DIK="^KLAS(1200,"
DO ^DIK
KILL DIK
EXIT3 XECUTE ^%ZIS("C")
KILL K,X1,T1,T2,P1,Z0,P2,X2,L,Z,X3,J,L3,L1,L2,X,BCS,BT,CR,GLOB,J,I,POP,SCREEN,SLCOUNT,SLINE,TB,TN,Y,IOTEMP,CLNUM,INSTRUCT,CLASS,SCOUNT,WCOUNT,LIMIT,SESSION,KNAM,KPORT,KNUM,%,RCOUNT,COM,DIC,DIE,DR,IOP,STU,FRNAME,ZB
+1 KILL %X,%Y,B,C,CTRL,END,EOFF,EON,FR,JOB,KLW,KXON,M,N1,N2,NFR,NULL,OPEX,START,SLDIC,STUDIR,TCK,TCP,TK,TL,TL1,TMC,TP,TT,TYP,ZE,TERMNORM,TERMKLAS
+2 USE 0
SET X=IOM
XECUTE ^%ZOSF("RM")
XECUTE ^%ZOSF("TRMOFF")
XECUTE ^%ZOSF("EON")
+3 USE 0:(0:::::#800001)
+4 QUIT
+5 ;
PICKUP ; PICKUP CONTROL OF ANOTHER CLASS
+1 XECUTE ^%ZOSF("EON")
SET DIC="^KLAS(1200,"
SET DIC(0)="AEQMZ"
SET DIC("S")="I JOB'=+Y"
DO ^DIC
IF Y'>0
GOTO EPICK
YN1 WRITE !,"Are You sure you want to become >>> ",Y(0,0),"<<<",!,"and the other job has been killed? Y/N "
+1 SET %=1
DO YN^DICN
IF %=-1!(%=2)
GOTO EPICK
IF %=0
WRITE !,"MAKE UP YOUR MIND",!
GOTO YN1
+2 SET NJOB=+Y
+3 SET ^KLAS(1200,JOB,"P3")=0
WRITE !,"CLEARING MOST RECENT START UP AND ANY USERS",!
XECUTE "F X=1:1:5 H 1 W ""."""
SET DA=JOB
SET DIK="^KLAS(1200,"
DO ^DIK
KILL DIK
+4 SET JOB=NJOB
SET SCOUNT=^KLAS(1200,JOB,"P1")
KILL DIC,NJOB
EPICK WRITE !,"----->ON LINE MODE<",!
XECUTE ^%ZOSF("EOFF")
KILL DIC,Y
QUIT
CON GOTO CON^KLASMAN