[641] | 1 | XBFRESET ; IHS/ADC/GTH - RESET FILE GLOBALS ; [ 02/07/97 3:02 PM ]
|
---|
| 2 | ;;4.0;XB;;Jul 20, 2009;Build 2
|
---|
| 3 | ;
|
---|
| 4 | ; This routine removes all data from FileMan files by
|
---|
| 5 | ; saving the 0th node, killing the global, then resetting
|
---|
| 6 | ; the 0th node.
|
---|
| 7 | ;
|
---|
| 8 | START ;
|
---|
| 9 | NEW I
|
---|
| 10 | W !!,$$REPEAT^XLFSTR("*",78),!,"This routine kills file data globals and resets the 0th nodes. If you are not",!,"absolutely sure of what you are doing, please ^ out at the first opportunity!",!,$$REPEAT^XLFSTR("*",78),!!
|
---|
| 11 | F I=1:1:3 W *7,"*** WARNING ***" H 1 W:I'=3 *13,$J("",79),*13
|
---|
| 12 | KILL I
|
---|
| 13 | W !!,"Select the files you wish reset."
|
---|
| 14 | D ^XBDSET
|
---|
| 15 | EN1 ;PEP - Interactive entry, files already selected.
|
---|
| 16 | Q:'$D(^UTILITY("XBDSET",$J))
|
---|
| 17 | W !!,"The following files globals will be killed and reset.",!
|
---|
| 18 | H 2
|
---|
| 19 | D EN^XBLZRO
|
---|
| 20 | Q:'$$DIR^XBDIR("Y","Do you want to continue","NO","","","",1)
|
---|
| 21 | EN2 ;PEP - Non-interactive entry, files already selected.
|
---|
| 22 | NEW F,G,X,Y
|
---|
| 23 | S F=""
|
---|
| 24 | F S F=$O(^UTILITY("XBDSET",$J,F)) Q:F="" D
|
---|
| 25 | . Q:'$D(^DIC(F,0,"GL")) S G=^("GL")
|
---|
| 26 | . S Y=G_"0)"
|
---|
| 27 | . S G=$E(G,1,$L(G)-1)_$S($E(G,$L(G))="(":"",1:")")
|
---|
| 28 | . W:'$D(ZTQUEUED) "."
|
---|
| 29 | . S X=@Y,X=$P(X,"^",1,2)_"^0^0"
|
---|
| 30 | . KILL @G
|
---|
| 31 | . S @Y=X
|
---|
| 32 | . Q
|
---|
| 33 | KILL ^UTILITY("XBDSET",$J)
|
---|
| 34 | Q
|
---|
| 35 | ;
|
---|