ZISETVXD ;SF/AC,ALB/PKE - INITIALIZE DEVICE FILE ;4/9/92 14:18
;;7.1;KERNEL;;Jun 08, 1993
W !,"THIS ROUTINE INITIALIZES THE DEVICE FILE WITH CURRENT PORT NUMBERS",!
EN ;
R "OK? ",X:$S($D(DTIME):DTIME,1:9999),!! G EXIT:X'?1"Y".E
L +^%ZIS:2 W:'$T !,"FILE IS IN USE. TRY AGAIN LATER!!!",*7 Q:'$T
I '$D(^%ZIS(1,0)) S ^%ZIS(1,0)="DEVICE^3.5"
S T=$P(^(0),"^",4),M=^%ZOSF("MGR"),%ZISV=$S($D(^%ZOSF("VOL")):^("VOL"),1:"") D FLST
QUES I %ZISV]"" W !,"Please Enter a Prefix for New Devices: "_%ZISV_"//" R %ZISV1:$S($D(DTIME):DTIME,1:300) G EXIT:%ZISV1="^"!'$T S:%ZISV1="" %ZISV1=%ZISV I %ZISV1?1"?"."?" D HLP G QUES
S IO="ZISETVXD.COM"
O IO:NEWVERSION U IO W "$ SHO DEV",! C IO
;
S %SPAWN="@ZISETVXD.COM/OUTPUT=ZISETVXD.DAT" D ^%SPAWN
;
S IO="ZISETVXD.DAT"
S $ZT="END^ZISETVXD" O IO U IO F Z=1:1 R X(Z):$S($D(DTIME):DTIME,1:60)
Q
END C IO F Z=1:1 Q:'$D(X(Z)) S X=$E(X(Z),1,2) I X="MU"!(X="OP"!(X="TT"!(X="TX"!(X="LP")))) S I=$E(X(Z),1,$F(X(Z),":")-1) W !,I S I="_"_I D CHK
L -^%ZIS
C K ^%ZIS("C") S ^%ZIS("C")="G ^%ZISC"
W !!,"ALL SETUP"
EXIT K %SPAWN,%ZISV,%ZISV1,A,I,L,LST,M,NM,T,X,Z Q
;
CHK Q:$S(%ZISV]"":$S($O(^%ZIS(1,"G","SYS."_%ZISV_"."_I,0))>0:1,$O(^%ZIS(1,"CPU",%ZISV_"."_I,0))>0:1,1:0),$O(^%ZIS(1,"C",I,0))>0:1,1:0) S NM=$S("_MU"[$E(I,1,3):"MT",1:$E(I,2,99))
ADD I %ZISV]"" S LST=LST+1 G:$D(^%ZIS(1,+LST,0))#2 ADD S T=T+1,^%ZIS(1,"C",I,+LST)="",^%ZIS(1,+LST,0)=%ZISV1_NM_"^"_I_"^1^1^^^^^"_%ZISV_"^^1",^("TYPE")=$S("_MU"[$E(I,1,3):"MT",1:"TRM"),^%ZIS(1,"B",%ZISV1_NM,+LST)="" D SETCNTR Q
ADD1 S LST=LST+1 G:$D(^%ZIS(1,+LST,0))#2 ADD1 S T=T+1,^%ZIS(1,"C",I,+LST)="",^%ZIS(1,+LST,0)=NM_"^"_I_"^1^1",^("TYPE")=$S("_MU"[$E(I,1,3):"MT",1:"TRM"),^%ZIS(1,"B",NM,+LST)="",$P(^%ZIS(1,0),"^",3)=+LST,$P(^(0),"^",4)=T Q
Q
SETCNTR S ^%ZIS(1,"CPU",%ZISV_"."_I,+LST)="",^%ZIS(1,"G","SYS."_%ZISV_"."_I,+LST)="",$P(^%ZIS(1,0),"^",3)=+LST,$P(^(0),"^",4)=T Q
FLST S X=$S($D(^%ZIS(1,0)):$P(^(0),"^",3),1:0),A=+X
F I=+X:0 S I=+$O(^%ZIS(1,I)) Q:I'>0 S A=I
S LST=A
HLP ;HELP FOR PREFIX QUESTION
W !,"There must be a prefix for a new device"
W !,"because the Device Name and the $I cannot"
W !,"be the same. This is being for the Single"
W !,"Device File.",! Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HZISETVXD 2203 printed Nov 22, 2024@17:24:53 Page 2
ZISETVXD ;SF/AC,ALB/PKE - INITIALIZE DEVICE FILE ;4/9/92 14:18
+1 ;;7.1;KERNEL;;Jun 08, 1993
+2 WRITE !,"THIS ROUTINE INITIALIZES THE DEVICE FILE WITH CURRENT PORT NUMBERS",!
EN ;
+1 READ "OK? ",X:$SELECT($DATA(DTIME):DTIME,1:9999),!!
if X'?1"Y".E
GOTO EXIT
+2 LOCK +^%ZIS:2
if '$TEST
WRITE !,"FILE IS IN USE. TRY AGAIN LATER!!!",*7
if '$TEST
QUIT
+3 IF '$DATA(^%ZIS(1,0))
SET ^%ZIS(1,0)="DEVICE^3.5"
+4 SET T=$PIECE(^(0),"^",4)
SET M=^%ZOSF("MGR")
SET %ZISV=$SELECT($DATA(^%ZOSF("VOL")):^("VOL"),1:"")
DO FLST
QUES IF %ZISV]""
WRITE !,"Please Enter a Prefix for New Devices: "_%ZISV_"//"
READ %ZISV1:$SELECT($DATA(DTIME):DTIME,1:300)
if %ZISV1="^"!'$TEST
GOTO EXIT
if %ZISV1=""
SET %ZISV1=%ZISV
IF %ZISV1?1"?"."?"
DO HLP
GOTO QUES
+1 SET IO="ZISETVXD.COM"
+2 OPEN IO:NEWVERSION
USE IO
WRITE "$ SHO DEV",!
CLOSE IO
+3 ;
+4 SET %SPAWN="@ZISETVXD.COM/OUTPUT=ZISETVXD.DAT"
DO ^%SPAWN
+5 ;
+6 SET IO="ZISETVXD.DAT"
+7 SET $ZT="END^ZISETVXD"
OPEN IO
USE IO
FOR Z=1:1
READ X(Z):$SELECT($DATA(DTIME):DTIME,1:60)
+8 QUIT
END CLOSE IO
FOR Z=1:1
if '$DATA(X(Z))
QUIT
SET X=$EXTRACT(X(Z),1,2)
IF X="MU"!(X="OP"!(X="TT"!(X="TX"!(X="LP"))))
SET I=$EXTRACT(X(Z),1,$FIND(X(Z),":")-1)
WRITE !,I
SET I="_"_I
DO CHK
+1 LOCK -^%ZIS
C KILL ^%ZIS("C")
SET ^%ZIS("C")="G ^%ZISC"
+1 WRITE !!,"ALL SETUP"
EXIT KILL %SPAWN,%ZISV,%ZISV1,A,I,L,LST,M,NM,T,X,Z
QUIT
+1 ;
CHK if $SELECT(%ZISV]""
QUIT
SET NM=$SELECT("_MU"[$EXTRACT(I,1,3):"MT",1:$EXTRACT(I,2,99))
ADD IF %ZISV]""
SET LST=LST+1
if $DATA(^%ZIS(1,+LST,0))#2
GOTO ADD
SET T=T+1
SET ^%ZIS(1,"C",I,+LST)=""
SET ^%ZIS(1,+LST,0)=%ZISV1_NM_"^"_I_"^1^1^^^^^"_%ZISV_"^^1"
SET ^("TYPE")=$SELECT("_MU"[$EXTRACT(I,1,3):"MT",1:"TRM")
SET ^%ZIS(1,"B",%ZISV1_NM,+LST)=""
DO SETCNTR
QUIT
ADD1 SET LST=LST+1
if $DATA(^%ZIS(1,+LST,0))#2
GOTO ADD1
SET T=T+1
SET ^%ZIS(1,"C",I,+LST)=""
SET ^%ZIS(1,+LST,0)=NM_"^"_I_"^1^1"
SET ^("TYPE")=$SELECT("_MU"[$EXTRACT(I,1,3):"MT",1:"TRM")
SET ^%ZIS(1,"B",NM,+LST)=""
SET $PIECE(^%ZIS(1,0),"^",3)=+LST
SET $PIECE(^(0),"^",4)=T
QUIT
+1 QUIT
SETCNTR SET ^%ZIS(1,"CPU",%ZISV_"."_I,+LST)=""
SET ^%ZIS(1,"G","SYS."_%ZISV_"."_I,+LST)=""
SET $PIECE(^%ZIS(1,0),"^",3)=+LST
SET $PIECE(^(0),"^",4)=T
QUIT
FLST SET X=$SELECT($DATA(^%ZIS(1,0)):$PIECE(^(0),"^",3),1:0)
SET A=+X
+1 FOR I=+X:0
SET I=+$ORDER(^%ZIS(1,I))
if I'>0
QUIT
SET A=I
+2 SET LST=A
HLP ;HELP FOR PREFIX QUESTION
+1 WRITE !,"There must be a prefix for a new device"
+2 WRITE !,"because the Device Name and the $I cannot"
+3 WRITE !,"be the same. This is being for the Single"
+4 WRITE !,"Device File.",!
QUIT