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

KLASMAN.m

Go to the documentation of this file.
KLASMAN ;GLRISC/PDW  CLASSMAN ROUTINE ;DEC 18,1990@13:54:58 [ 12/13/94  8:01 AM ]
 ;;1.0
EN D DT^DICRW
 S OPEX="Q",X=0 X ^%ZOSF("RM") S TYP=^%ZOSF("TYPE-AHEAD")
 X ^%ZOSF("NBRK")
 S X="CLASS" S IOP=$O(^%ZIS(1,"B",X)) I $E(IOP,1,5)'=X W !,"NO LOOPBACKS WITH 'CLASS' " K X,IOP
OPEN D ^%ZIS I POP K POP,IOP W !,"SORRY ! ... no Loopbacks available.",! S IOP="HOME" D ^%ZIS Q
 S X=0 U IO X ^%ZOSF("RM") U IO(0) S X=0 X ^%ZOSF("RM")
 I ^%ZOSF("OS")["MSM-UNIX" U IO:(::::+2097152+4096+512+1:+8388608+262144+64) ;set passall;ctrl/O as data;assert DTR;no echo;;input buffer XON;7b data
EN1 ;
DISP I $D(^KLAS(1200,"B")) U IO(0) W !,"Existing Classes are: ",! S DIC="^KLAS(1200,",DIC(0)="AEQMZ",D="B",DZ="??" D DQ^DICQ
 ;
 ;U 0:(0::::#000001:#800040:::$C(8,13,15,18,21,24,27,127)) W !
 I ^%ZOSF("OS")["MSM-UNIX" U IO:(::::+2097152+4096+512+1:+8388608+262144+64) ;set passall;ctrl/O as data;assert DTR;no echo;;input buffer XON;7b data
 U IO(0) W !,"You are using loopback : ",ION,?$X+5,IO,!
 S KNAM=ION,KPORT=IO,COM=0,ZB=^%ZOSF("TRMRD"),TERMNORM="S X=IOM X ^%ZOSF(""RM""),^(""EON""),^(""TRMOFF""),^(""TYPE-AHEAD"")",TERMKLAS="S X=0 X ^%ZOSF(""RM""),^(""EOFF""),^(""TRMON""),^(""TYPE-AHEAD"")"
 U IO(0) X TERMNORM
 S Z0=1,BCS=0,BT=$P($H,",",2),SCREEN=0,X2=0,T1=1,P1=0,P2=0,(SCOUNT,WCOUNT)=0,LIMIT=1000,TL=$P($H,",",2),CTRL=5,STUDIR=0
 S SLINE="",CR=$C(13),SCREEN=0,SLCOUNT=0,GLOB="" ; VARIABLES FOR SCREEN SAVE
 K DIE,DIC S X="NEW",DIC="^KLAS(1200,",DIC(0)="MLZ",DIC("DR")=".5;1;6///"_KNAM D FILE^DICN K DIC G:Y'>0 EXIT3^KLASMAN0 S JOB=+Y,^KLAS(1200,JOB,"M",0)="^1200.03A^^",^KLAS(1200,JOB,"P1")=""
A S DIC="^KLAS(1200.4,",DIC(0)="QMLZ",X=$P(Y(0),"^",2),DIC("DR")="1///"_Y(0,0)_";1.5//NO;2///NOW;3///NOW" D FILE^DICN S CLNUM=+Y
 S ^KLAS(1200.4,CLNUM,1,0)="^1200.44^^"
 K DIC S DIE="^KLAS(1200,",DA=JOB,DR="2////"_CLNUM D ^DIE K DIE
 U IO(0) W !,"The current Command Character is CTRL-",$C(CTRL+64),!
REVIEW D DOC^KLASMAN3 S Z="WELCOME TO THE CLASS" D BCS
CON ; CONTINUE RE-ENTRY POINT
 S Z="",NULL="",KXON=0 U IO S X=0 X ^%ZOSF("RM"),^("EOFF"),^("TYPE-AHEAD"),^("TRMOFF")
 U IO(0) X TERMKLAS
 U IO:(0::::#001001:#800040:::$C(3,8,13,21,24,27,127))
 ;U IO:(0::::#801001),0:(0::::#8000001)
 ;I ^%ZOSF("OS")["MSM-UNIX" U IO:(::::+2097152+4096+512+1:+8388608+262144+64) ;set passall;ctrl/O as data;assert DTR;no echo;;input buffer XON;7b data
 S CC=$C(CTRL),TK=0,TP=0,TMC="X ^%ZOSF(""TRMRD"")",(TCK,TCP,JMP)="",TT=0 S:'$D(STUDIR) STUDIR=0 S TN=$P($H,",",2),(TL,TL1,TSL)=TN
INPUT S WCOUNT=0,JMP="",L3=0
 F K=0:0 D KEYB Q:JMP'=""
 I JMP="CTRL" U IO(0) W:$D(KLASPG) @IOF D CTRL^KLASMAN0 U IO(0) H:$D(KLASPG) 1 W:$D(KLASPG) @IOF U IO G:(JMP'="EXIT") CON
 U IO(0) X TERMKLAS I JMP="EXIT" X TERMNORM K JMP G EXIT^KLASMAN0
 G INPUT
 ;
KEYB ;
 S TN=$P($H,",",2) I COM D KEY G OUT
 U IO(0) R Z:TK S Z=TCK_Z,TCK="",TK=0 I  X TMC S TCK=$C(Y) S:Y=CTRL Y=0,JMP="CTRL",TCK="" S:Y=27 TK=1 I Y=13 U IO W Z,*Y S Z="",TCK="",TL=TN
 I $L(Z),Z'="" S TP=0,TL=TN U IO W Z
OUT ;
 U IO W:KXON *17 R Z#200:TP S:$T TT=1 X TMC W:KXON *19 S Z=TCP_Z,TCP="" I TT S TCP=$C(Y),TP=1,TT=0
 I $L(Z) U IO(0) S TL=TN W Z D:Z0 BCS
TIMER S TN=$P($H,",",2) I TP,(TN-TL>90),Z="" S Z=" "_$C(8),(TL,TL1)=TN U IO(0) W Z D:Z0 BCS U IO W " " R Z#1:3 W:Z=" " *127 D:Z=" " BCS U IO(0) W Z U IO
 I TP=0 S:(TN-TL>8) TP=1
MSG I $D(^KLAS(1200,JOB,"AMSG")) S MSGDA=$O(^("AMSG","")),MSG=$O(^(MSGDA,"")) U IO(0) W:MSG'="" *7,!,?30,"*** ",MSG," ***",! S:MSG="BDIRECT" STUDIR=1 S:MSG="EDIRECT" STUDIR=0 H 1 K ^(MSG),MSG,MSGDA
 Q
BCS ;
 Q:Z=""  S SCOUNT=SCOUNT+1,^KLAS(1200,JOB,"S",SCOUNT,0)=Z,^KLAS(1200,JOB,"P1")=SCOUNT S:SCOUNT>(LIMIT-1) SCOUNT=0 D:SCREEN SLINE
 Q
KEY ;CODE TO SCAN STUDENT INPUT FOR APPLICATION AND INSTRUCTOR FOR INTERUPT
 S RCOUNT=^KLAS(1200,JOB,"R1") U IO(0) R Z:0 I  W !,"TAKING COMMAND",! D COMOLD^KLASMAN0 S STUDIR=0 Q
 I (WCOUNT=LIMIT)&(RCOUNT'=LIMIT) S WCOUNT=0
 I WCOUNT'=RCOUNT S TP=0,TL=TN F WCOUNT=WCOUNT+1:1:$S(RCOUNT>WCOUNT:RCOUNT,1:LIMIT) D:'$D(^KLAS(1200,JOB,"R",WCOUNT,0)) LOOPD S Z=^KLAS(1200,JOB,"R",WCOUNT,0) G:STUDIR STUDIR U IO W:Z'=$C(13) Z W:Z=$C(13) "",*13
 S Z=""
 Q
LOOPD ;
 G:'$D(^KLAS(1200,JOB,"R",WCOUNT,0)) LOOPD
 Q
STUDIR D BCS U IO(0) W Z I TN-TL1>90 U IO W " " H 1 W *127 S TL1=TN
 Q
SLINE ; SAVE SCREENS TO GLOB
 Q:Z=""  I Z[CR D SLSET S SLINE=Z,Z="" Q
 S LEN=$L(Z)+$L(SLINE) I LEN>230 D SLSET S SLINE=Z,Z="" Q
 S SLINE=SLINE_Z,Z="" D:(TN-TSL>15) SLSET Q
SLSET ;
 F CHAR=10,12,13 F I=0:0 S X=$F(SLINE,$C(CHAR)) Q:'X  S SLINE=$E(SLINE,0,X-2)_$E(SLINE,X,999)
 S SLCOUNT=SLCOUNT+1,@(GLOB_SLCOUNT_",0)")=SLINE,SLINE="",TSL=TN
 Q
EX1 W !,"SORRY NO PORTS AVAILABLE",! K KNAM,X,IOP L  Q
 ;-----------------------------------------------------------
CLEAN D CLEAN^KLASMAN1 Q
XRAY D XRAY^KLASDIA Q
XX D XX^KLASDIA Q
STUFF D STUFF^KLASDIA Q
PICK D PICKUP^KLASMAN0 S KLW=SCOUNT Q
SXRAY D SXRAY^KLASDIA Q
SXX D SXX^KLASDIA Q