AUDICV ;SET DICTIONARY VERSION NUMBERS [ 03/11/88 10:12 AM ]
;
BEGIN S DUZ(0)="@",U="^" D CURRENT^%ZIS
W !!,"This program sets FileMan dictionary version numbers."
;
S (AUDICVHI,AUDICVQF)=0
D GETDICS ; Get set of dictionaries
I AUDICVQF D EOJ Q
D SHOW ; Show current versions
D ASK ; See if user wants control
I AUDICVQF D EOJ Q
D VER ; Get new version number
I AUDICVQF D EOJ Q
D CHANGE ; Change version numbers
D EOJ ; Clean up
Q
;
GETDICS ; GET SET OF DICTIONARIES
D ^%AUDSET
S:'$D(^UTILITY("AUDSET",$J)) AUDICVQF=1
Q
;
SHOW ; SHOW CURRENT VERSION NUMBERS
W ! S AUDICVFL="" F AUDICVL=0:0 S AUDICVFL=$O(^UTILITY("AUDSET",$J,AUDICVFL)) Q:AUDICVFL="" W !,$P(^DIC(AUDICVFL,0),U,1),$S($D(^DD(AUDICVFL,0,"VR")):"..Current version is "_^("VR"),1:"..No version") D HIGH
Q
HIGH ; SAVE HIGH VERSION NUMBER
I $D(^DD(AUDICVFL,0,"VR")),+^("VR")>+AUDICVHI S AUDICVHI=^("VR")
Q
;
ASK W !!,"Do you want to be asked before setting each file? (Y/N) Y// " R AUDICVASK S:AUDICVASK="" AUDICVASK="Y" I "^YyNn"'[AUDICVASK W *7 G ASK
I AUDICVASK["^" S AUDICVQF=1 Q
S AUDICVASK=$S("Yy"[$E(AUDICVASK):1,1:0)
Q
;
VER R !!,"New version number: ",AUDICVVR
I AUDICVVR["^" S AUDICVQF=1 Q
I AUDICVVR'?1N.N.".".N W *7 G VER
I +AUDICVVR<+AUDICVHI W !,"One or more selected files already has a version number greater than ",AUDICVVR,*7 G VER
Q
;
CHANGE ; CHANGE VERSION NUMBERS
W !
S AUDICVFL="" F AUDICVL=0:0 S AUDICVFL=$O(^UTILITY("AUDSET",$J,AUDICVFL)) Q:AUDICVFL="" D PROCESS
Q
;
PROCESS ;
S AUDICVANS="Y"
W !,$P(^DIC(AUDICVFL,0),U,1),$S($D(^DD(AUDICVFL,0,"VR")):"..Current version is "_^("VR"),1:"..No version"),$S(AUDICVASK:"..OK? Y// ",1:"")
P2 I AUDICVASK R AUDICVANS S:AUDICVANS="" AUDICVANS="Y" I "YyNn"'[$E(AUDICVANS) D P2ERR G P2
I AUDICVANS="Y" S ^DD(AUDICVFL,0,"VR")=AUDICVVR W " Changed to ",AUDICVVR
Q
P2ERR W *7 F AUDICVI=1:1:$L(AUDICVANS) W @BS," ",@BS
Q
;
EOJ ;
K ^UTILITY("AUDSET",$J)
K AUDICVANS,AUDICVASK,AUDICVFL,AUDICVHI,AUDICVI,AUDICVL,AUDICVQF,AUDICVVR
K BS,FF,RM,SL,SUB,XY
W !!,"Bye",!!
Q
AUDICV ;SET DICTIONARY VERSION NUMBERS [ 03/11/88 10:12 AM ]
+1 ;
BEGIN SET DUZ(0)="@"
SET U="^"
DO CURRENT^%ZIS
+1 WRITE !!,"This program sets FileMan dictionary version numbers."
+2 ;
+3 SET (AUDICVHI,AUDICVQF)=0
+4 ; Get set of dictionaries
DO GETDICS
+5 IF AUDICVQF
DO EOJ
QUIT
+6 ; Show current versions
DO SHOW
+7 ; See if user wants control
DO ASK
+8 IF AUDICVQF
DO EOJ
QUIT
+9 ; Get new version number
DO VER
+10 IF AUDICVQF
DO EOJ
QUIT
+11 ; Change version numbers
DO CHANGE
+12 ; Clean up
DO EOJ
+13 QUIT
+14 ;
GETDICS ; GET SET OF DICTIONARIES
+1 DO ^%AUDSET
+2 IF '$DATA(^UTILITY("AUDSET",$JOB))
SET AUDICVQF=1
+3 QUIT
+4 ;
SHOW ; SHOW CURRENT VERSION NUMBERS
+1 WRITE !
SET AUDICVFL=""
FOR AUDICVL=0:0
SET AUDICVFL=$ORDER(^UTILITY("AUDSET",$JOB,AUDICVFL))
IF AUDICVFL=""
QUIT
WRITE !,$PIECE(^DIC(AUDICVFL,0),U,1),$SELECT($DATA(^DD(AUDICVFL,0,"VR")):"..Current version is "_^("VR"),1:"..No version")
DO HIGH
+2 QUIT
HIGH ; SAVE HIGH VERSION NUMBER
+1 IF $DATA(^DD(AUDICVFL,0,"VR"))
IF +^("VR")>+AUDICVHI
SET AUDICVHI=^("VR")
+2 QUIT
+3 ;
ASK WRITE !!,"Do you want to be asked before setting each file? (Y/N) Y// "
READ AUDICVASK
IF AUDICVASK=""
SET AUDICVASK="Y"
IF "^YyNn"'[AUDICVASK
WRITE *7
GOTO ASK
+1 IF AUDICVASK["^"
SET AUDICVQF=1
QUIT
+2 SET AUDICVASK=$SELECT("Yy"[$EXTRACT(AUDICVASK):1,1:0)
+3 QUIT
+4 ;
VER READ !!,"New version number: ",AUDICVVR
+1 IF AUDICVVR["^"
SET AUDICVQF=1
QUIT
+2 IF AUDICVVR'?1N.N.".".N
WRITE *7
GOTO VER
+3 IF +AUDICVVR<+AUDICVHI
WRITE !,"One or more selected files already has a version number greater than ",AUDICVVR,*7
GOTO VER
+4 QUIT
+5 ;
CHANGE ; CHANGE VERSION NUMBERS
+1 WRITE !
+2 SET AUDICVFL=""
FOR AUDICVL=0:0
SET AUDICVFL=$ORDER(^UTILITY("AUDSET",$JOB,AUDICVFL))
IF AUDICVFL=""
QUIT
DO PROCESS
+3 QUIT
+4 ;
PROCESS ;
+1 SET AUDICVANS="Y"
+2 WRITE !,$PIECE(^DIC(AUDICVFL,0),U,1),$SELECT($DATA(^DD(AUDICVFL,0,"VR")):"..Current version is "_^("VR"),1:"..No version"),$SELECT(AUDICVASK:"..OK? Y// ",1:"")
P2 IF AUDICVASK
READ AUDICVANS
IF AUDICVANS=""
SET AUDICVANS="Y"
IF "YyNn"'[$EXTRACT(AUDICVANS)
DO P2ERR
GOTO P2
+1 IF AUDICVANS="Y"
SET ^DD(AUDICVFL,0,"VR")=AUDICVVR
WRITE " Changed to ",AUDICVVR
+2 QUIT
P2ERR WRITE *7
FOR AUDICVI=1:1:$LENGTH(AUDICVANS)
WRITE @BS," ",@BS
+1 QUIT
+2 ;
EOJ ;
+1 KILL ^UTILITY("AUDSET",$JOB)
+2 KILL AUDICVANS,AUDICVASK,AUDICVFL,AUDICVHI,AUDICVI,AUDICVL,AUDICVQF,AUDICVVR
+3 KILL BS,FF,RM,SL,SUB,XY
+4 WRITE !!,"Bye",!!
+5 QUIT