Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: KLASMAN0

KLASMAN0.m

Go to the documentation of this file.
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