64 lines
2.2 KiB
Mathematica
64 lines
2.2 KiB
Mathematica
|
XBKD3 ; IHS/ADC/GTH - KILLS DICs and GLOBALS (PART 3) ; [ 02/07/97 3:02 PM ]
|
||
|
;;4.0;XB;;Jul 20, 2009;Build 2
|
||
|
;
|
||
|
; Part of XBKD
|
||
|
;
|
||
|
; Upon entry into this routine ^DIC(file #,0) must contain
|
||
|
; the file name, and, if the data global is to be deleted
|
||
|
; piece 3 of ^UTILITY("XBDSET",$J,file #) must be a valid
|
||
|
; global reference.
|
||
|
;
|
||
|
START ;
|
||
|
W !!
|
||
|
KILL ^UTILITY("XBKD",$J)
|
||
|
S (XBKDFILE,XBKDFLG)=0
|
||
|
F XBKDL=0:0 S XBKDFILE=$O(^UTILITY("XBDSET",$J,XBKDFILE)) Q:XBKDFILE="" S XBKDDEL=$P(^(XBKDFILE),U,1),XBKDTMP=$P(^(XBKDFILE),U,2),XBKDG=$P(^(XBKDFILE),U,3) D KILL Q:XBKDFLG
|
||
|
Q
|
||
|
;
|
||
|
KILL ;
|
||
|
S XBKDG="^"_$E(XBKDG,1,$L(XBKDG)-1)_$S($E(XBKDG,$L(XBKDG))=",":")",1:"")
|
||
|
S XBKDNDIC=$P(^DIC(XBKDFILE,0),U,1)
|
||
|
W XBKDFILE,?14,$P(^DIC(XBKDFILE,0),U,1)," <WAIT>"
|
||
|
I XBKDTMP'="D" D SAVE
|
||
|
KILL XBKDSFL
|
||
|
S XBKDC=1,XBKDSFL(XBKDC)=XBKDFILE
|
||
|
D SBTRACE
|
||
|
KILL XBKDC,XBKDI,XBKDSF,XBKDSFL
|
||
|
KILL ^DD("ACOMP",XBKDFILE)
|
||
|
KILL ^DIC(XBKDFILE,"%"),^("%A"),^("%D"),^DIC("B",XBKDNDIC,XBKDFILE)
|
||
|
I XBKDG'["DIC(",XBKDTMP="D" KILL ^DIC(XBKDFILE,0)
|
||
|
K:XBKDDEL="D" @XBKDG
|
||
|
I XBKDTMP="D" F DIK="^DIE(","^DIPT(","^DIBT(" W "." KILL @(DIK_"""F""_XBKDFILE)") F DA=.9:0 S DA=$O(@(DIK_"DA)")) Q:DA'>0 I $D(^(DA,0)) S %=$P(^(0),U,4) I %=""!'$D(^DD(+%)) W "." D ^DIK
|
||
|
W !!
|
||
|
Q
|
||
|
;
|
||
|
SBTRACE ; Delete all Sub-Files.
|
||
|
F XBKDL=0:0 S XBKDI=$O(XBKDSFL("")) Q:XBKDI="" S XBKDSF=XBKDSFL(XBKDI) D SBTRACE2 S XBKDI=$O(XBKDSFL("")) W "." KILL ^DD(XBKDSFL(XBKDI)),XBKDSFL(XBKDI)
|
||
|
Q
|
||
|
;
|
||
|
SBTRACE2 ;
|
||
|
S XBKDI=0
|
||
|
F XBKDL=0:0 S XBKDI=$O(^DD(XBKDSF,"SB",XBKDI)) Q:XBKDI="" S XBKDC=XBKDC+1,XBKDSFL(XBKDC)=XBKDI
|
||
|
Q
|
||
|
;
|
||
|
SAVE ; Save "PT", "TRB", and "ACOMP" node from ^DD.
|
||
|
S XBKDFLD=""
|
||
|
F XBKDL=0:0 S XBKDFLD=$O(^DD("ACOMP",XBKDFILE,XBKDFLD)) Q:XBKDFLD="" S XBKDFLE2="" F XBKDL=0:0 S XBKDFLE2=$O(^DD("ACOMP",XBKDFILE,XBKDFLD,XBKDFLE2)) Q:XBKDFLE2="" D SAVE2
|
||
|
KILL ^DD(XBKDFILE,0,"PT",XBKDFILE),XBKDFLE2
|
||
|
W "."
|
||
|
S FROM="^DD("_XBKDFILE_",0,""PT"",",TO="^UTILITY(""XBKD"",$J,"_XBKDFILE_",0,""PT"","
|
||
|
D ^XBGXFR
|
||
|
KILL ^DD(XBKDFILE,"TRB",XBKDFILE)
|
||
|
W "."
|
||
|
S FROM="^DD("_XBKDFILE_",""TRB"",",TO="^UTILITY(""XBKD"",$J,"_XBKDFILE_",""TRB"","
|
||
|
D ^XBGXFR
|
||
|
W "."
|
||
|
S FROM="^DD(""ACOMP"","_XBKDFILE_",",TO="^UTILITY(""XBKD"",$J,""ACOMP"","_XBKDFILE_","
|
||
|
D ^XBGXFR
|
||
|
Q
|
||
|
;
|
||
|
SAVE2 ;
|
||
|
I '$D(^DIC(XBKDFLE2))!(XBKDFILE=XBKDFLE2) W "." KILL ^DD("ACOMP",XBKDFILE,XBKDFLD,XBKDFLE2)
|
||
|
Q
|
||
|
;
|