ZIBVKIL ; IHS/ADC/GTH - BUILD A KILL VARIABLE ROUTINE ; [ 11/04/97 10:26 AM ]
;;3.0;IHS/VA UTILITIES;**4**;FEB 07, 1997
; XB*3*4 IHS/ADC/GTH 05-22-97 Prevent <INDER> err.
;
; Build a name space variable killer routine in ^.ns.KVAR.
;
; Select a %INDEX host file summary from which to build the
; routine. Select a name space for the variables and the
; routine to be built. Enter any package wide variables.
;
; Add D ^.ns.VKL0 to all menu exit actions where package
; variables are to remain.
;
; Add D KILL^XUSCLEAN to the exit of all other menus.
;
; I $P(^%ZOSF("OS"),"-",1)'="MSM" W !,*7,"OPERATING SYSTEM '",$P(^%ZOSF("OS"),"-",1),"' NOT SUPPORTED." Q ; XB*3*4 IHS/ADC/GTH 05-22-97 Prevent <INDER> err.
I $P(^%ZOSF("OS"),"^",1)'["MSM" W !,*7,"OPERATING SYSTEM '",$P(^%ZOSF("OS"),"^",1),"' NOT SUPPORTED." Q ; XB*3*4 IHS/ADC/GTH 05-22-97 Prevent <INDER> err.
;
D HOME^%ZIS
NEW XBNS
NS ;
KILL DIR
S DIR(0)="F^2:4",DIR("A")="Name Space - or ' ^ 'to exit"
D ^DIR
I X="^" G EXIT
I Y="" G NS
I '$D(^DIC(9.4,"C",Y)) W !,"NO PACKAGE ??",! G NS
S XBNS=Y
PKGVAR ;
KILL DIR
S DIR(0)="F^0:235",DIR("A")="List of Package Wide Variables or '^' to bypass",DIR("?")="LIST var1,var2, ... "
D ^DIR
I Y'="^" F XBI=1:1 S X=$P(Y,",",XBI) Q:X="" S XBVPKG(X)=""
KROU ;
KILL DIR
S DIR(0)="F^0:235",DIR("A")="List of other Kill routines to chain",DIR("?")=" ^ROU1,^ROU2, ... with '^'s"
D ^DIR
I Y]"",Y'="^" F XBI=1:1 S XBROU=$P(Y,",",XBI) Q:XBROU="" S X=$P(XBROU,"^",2) D
. I X="" W !,XBROU," error in list >> ",Y G KROU
. X ^%ZOSF("TEST")
. I '$T W !,X," error in list >> ",Y G KROU
.Q
I Y]"" S XBKROU=" D "_Y
D ^XBVCHV
I '$D(^XBVROU($J)) W !,"NO FILE ??",! G NS
S ;
F I=1:1 Q:'$T(@I) S XBLD(I)=$P($T(@I),";;",2,99)
X XBLD(1)
EXIT ;
D KILL^XUSCLEAN
KILL ^XBVROU($J),XBKROU,XBLD
W !,"REMEMBER TO EDIT THE TOP LINES OF THE ROUTINES CREATED !",!!
Q
;
1 ;;S XBNUM=0 X XBLD(2),XBLD(3),XBLD(4),XBLD(6) ZS @XBROU W !,XBROU," Saved ",!!
2 ;;ZR S XBROU=XBNS_"VKL"_XBNUM,X=XBROU_" ; - kill variables",XBLNS=$L(XBNS) ZI X S X=" ;;" ZI X
3 ;;S XBVAR=XBNS,XBHD=" K ",X=" K " F S XBVAR=$O(^XBVROU($J,"V",XBVAR)) Q:$E(XBVAR,1,XBLNS)'=XBNS I '$D(XBVPKG(XBVAR)) S X=X_XBVAR_"," S XBLX=$L(X) I XBLX>235 S X=$E(X,1,XBLX-1) ZI X S X=" K " X ^%ZOSF("SIZE") I Y>3000 X XBLD(5),XBLD(2)
4 ;;S XBLX=$L(X) I XBLX>3 S X=$E(X,1,XBLX-1) ZI X
5 ;;S XBNUM=XBNUM+1 S X=" D ^"_XBNS_"VKL"_XBNUM ZI X ZS @XBROU W !,XBROU," Saved",!!
6 ;;I $D(XBKROU) S X=XBKROU ZI X W !,"ADDING ",X,!
ZIBVKIL ; IHS/ADC/GTH - BUILD A KILL VARIABLE ROUTINE ; [ 11/04/97 10:26 AM ]
+1 ;;3.0;IHS/VA UTILITIES;**4**;FEB 07, 1997
+2 ; XB*3*4 IHS/ADC/GTH 05-22-97 Prevent <INDER> err.
+3 ;
+4 ; Build a name space variable killer routine in ^.ns.KVAR.
+5 ;
+6 ; Select a %INDEX host file summary from which to build the
+7 ; routine. Select a name space for the variables and the
+8 ; routine to be built. Enter any package wide variables.
+9 ;
+10 ; Add D ^.ns.VKL0 to all menu exit actions where package
+11 ; variables are to remain.
+12 ;
+13 ; Add D KILL^XUSCLEAN to the exit of all other menus.
+14 ;
+15 ; I $P(^%ZOSF("OS"),"-",1)'="MSM" W !,*7,"OPERATING SYSTEM '",$P(^%ZOSF("OS"),"-",1),"' NOT SUPPORTED." Q ; XB*3*4 IHS/ADC/GTH 05-22-97 Prevent <INDER> err.
+16 ; XB*3*4 IHS/ADC/GTH 05-22-97 Prevent <INDER> err.
IF $PIECE(^%ZOSF("OS"),"^",1)'["MSM"
WRITE !,*7,"OPERATING SYSTEM '",$PIECE(^%ZOSF("OS"),"^",1),"' NOT SUPPORTED."
QUIT
+17 ;
+18 DO HOME^%ZIS
+19 NEW XBNS
NS ;
+1 KILL DIR
+2 SET DIR(0)="F^2:4"
SET DIR("A")="Name Space - or ' ^ 'to exit"
+3 DO ^DIR
+4 IF X="^"
GOTO EXIT
+5 IF Y=""
GOTO NS
+6 IF '$DATA(^DIC(9.4,"C",Y))
WRITE !,"NO PACKAGE ??",!
GOTO NS
+7 SET XBNS=Y
PKGVAR ;
+1 KILL DIR
+2 SET DIR(0)="F^0:235"
SET DIR("A")="List of Package Wide Variables or '^' to bypass"
SET DIR("?")="LIST var1,var2, ... "
+3 DO ^DIR
+4 IF Y'="^"
FOR XBI=1:1
SET X=$PIECE(Y,",",XBI)
IF X=""
QUIT
SET XBVPKG(X)=""
KROU ;
+1 KILL DIR
+2 SET DIR(0)="F^0:235"
SET DIR("A")="List of other Kill routines to chain"
SET DIR("?")=" ^ROU1,^ROU2, ... with '^'s"
+3 DO ^DIR
+4 IF Y]""
IF Y'="^"
FOR XBI=1:1
SET XBROU=$PIECE(Y,",",XBI)
IF XBROU=""
QUIT
SET X=$PIECE(XBROU,"^",2)
Begin DoDot:1
+5 IF X=""
WRITE !,XBROU," error in list >> ",Y
GOTO KROU
+6 XECUTE ^%ZOSF("TEST")
+7 IF '$TEST
WRITE !,X," error in list >> ",Y
GOTO KROU
+8 QUIT
End DoDot:1
+9 IF Y]""
SET XBKROU=" D "_Y
+10 DO ^XBVCHV
+11 IF '$DATA(^XBVROU($JOB))
WRITE !,"NO FILE ??",!
GOTO NS
S ;
+1 FOR I=1:1
IF '$TEXT(@I)
QUIT
SET XBLD(I)=$PIECE($TEXT(@I),";;",2,99)
+2 XECUTE XBLD(1)
EXIT ;
+1 DO KILL^XUSCLEAN
+2 KILL ^XBVROU($JOB),XBKROU,XBLD
+3 WRITE !,"REMEMBER TO EDIT THE TOP LINES OF THE ROUTINES CREATED !",!!
+4 QUIT
+5 ;
1 ;;S XBNUM=0 X XBLD(2),XBLD(3),XBLD(4),XBLD(6) ZS @XBROU W !,XBROU," Saved ",!!
2 ;;ZR S XBROU=XBNS_"VKL"_XBNUM,X=XBROU_" ; - kill variables",XBLNS=$L(XBNS) ZI X S X=" ;;" ZI X
3 ;;S XBVAR=XBNS,XBHD=" K ",X=" K " F S XBVAR=$O(^XBVROU($J,"V",XBVAR)) Q:$E(XBVAR,1,XBLNS)'=XBNS I '$D(XBVPKG(XBVAR)) S X=X_XBVAR_"," S XBLX=$L(X) I XBLX>235 S X=$E(X,1,XBLX-1) ZI X S X=" K " X ^%ZOSF("SIZE") I Y>3000 X XBLD(5),XBLD(2)
4 ;;S XBLX=$L(X) I XBLX>3 S X=$E(X,1,XBLX-1) ZI X
5 ;;S XBNUM=XBNUM+1 S X=" D ^"_XBNS_"VKL"_XBNUM ZI X ZS @XBROU W !,XBROU," Saved",!!
6 ;;I $D(XBKROU) S X=XBKROU ZI X W !,"ADDING ",X,!