AUGCMPX ; COMPARES GLOBAL TREES [ 02/18/88 9:39 AM ]
; CREATED BY GIS 7/17/85 FOR MSM UNIX MUMPS (2.3)
GP R !!,"Primary global: [e.g. ^GBL( or ^GBL(10,] ",AUGP Q:AUGP="" I AUGP["^",AUGP["(","(,"[$E(AUGP,$L(AUGP)) G GS
Q
GS R !!,"Secondary global: [same] ",AUGS Q:AUGS="" I AUGS["^",AUGS["(","(,"[$E(AUGS,$L(AUGS)) D EN
Q
EN ; EXTERNAL ENTRY POINT
I $D(AUGP),AUGP'="",$D(AUGS),AUGS'="" G CONT
Q
CONT ;
S:'$D(AUGSTOP) AUGSTOP="I 0"
D SEARCH K AUGP,AUGS,AUGSTOP Q
SEARCH ;
N (AUGP,AUGS,AUGSTOP)
S T="T",C=",",P=")",NT=$L(AUGP,C)-1,L=1,T1=""
S TT=AUGP F I=1:1:30 S TT=TT_T_I_C
EXTR S X=T_L,Y=$P(TT,C,1,L+NT)_P,@X=$O(@Y)
X AUGSTOP Q:$T
I @X'="" D:$D(@(Y))#2 SUB S L=L+1,@(T_L)="" G EXTR
S L=L-1 Q:L=0 G EXTR
SUB W "." S ZZ=AUGS_$P(Y,AUGP,2)
I '$D(@ZZ) W !,ZZ," does not exist" Q
I @ZZ'=@Y W !,ZZ," not same as ",Y Q
Q
AUGCMPX ; COMPARES GLOBAL TREES [ 02/18/88 9:39 AM ]
+1 ; CREATED BY GIS 7/17/85 FOR MSM UNIX MUMPS (2.3)
GP READ !!,"Primary global: [e.g. ^GBL( or ^GBL(10,] ",AUGP
IF AUGP=""
QUIT
IF AUGP["^"
IF AUGP["("
IF "(,"[$EXTRACT(AUGP,$LENGTH(AUGP))
GOTO GS
+1 QUIT
GS READ !!,"Secondary global: [same] ",AUGS
IF AUGS=""
QUIT
IF AUGS["^"
IF AUGS["("
IF "(,"[$EXTRACT(AUGS,$LENGTH(AUGS))
DO EN
+1 QUIT
EN ; EXTERNAL ENTRY POINT
+1 IF $DATA(AUGP)
IF AUGP'=""
IF $DATA(AUGS)
IF AUGS'=""
GOTO CONT
+2 QUIT
CONT ;
+1 IF '$DATA(AUGSTOP)
SET AUGSTOP="I 0"
+2 DO SEARCH
KILL AUGP,AUGS,AUGSTOP
QUIT
SEARCH ;
+1 NEW (AUGP,AUGS,AUGSTOP)
+2 SET T="T"
SET C=","
SET P=")"
SET NT=$LENGTH(AUGP,C)-1
SET L=1
SET T1=""
+3 SET TT=AUGP
FOR I=1:1:30
SET TT=TT_T_I_C
EXTR SET X=T_L
SET Y=$PIECE(TT,C,1,L+NT)_P
SET @X=$ORDER(@Y)
+1 XECUTE AUGSTOP
IF $TEST
QUIT
+2 IF @X'=""
IF $DATA(@(Y))#2
DO SUB
SET L=L+1
SET @(T_L)=""
GOTO EXTR
+3 SET L=L-1
IF L=0
QUIT
GOTO EXTR
SUB WRITE "."
SET ZZ=AUGS_$PIECE(Y,AUGP,2)
+1 IF '$DATA(@ZZ)
WRITE !,ZZ," does not exist"
QUIT
+2 IF @ZZ'=@Y
WRITE !,ZZ," not same as ",Y
QUIT
+3 QUIT