cQVGCOR ;Correct differences in globals ;cQVGCOR; ; ; Ask Global, Display and Set ? 1 N x,y,z W !!,"Global: " R x G YZ:x="" 2 W !!,"Display: " R y G 1:"-NnYy"'[y S y="yY"[y 3 W !!,"Set: : " R z G 2:"-nNYy"'[z S z=z="y"+(z="Y") 4 I y+z'=0 D @$S(y+z=2:"DSET(x)",z=1:"SET(x)",1:"DISP(x)") ; YZ Q ; X(x) N d,g,y s x=$G(x) Q:'$L(x) S:$E(x)'="^" x="^"_x I x["(",$E(x,$L(x))'=")" S x=x_")" S y=x D:$D(@x)#10 L F S x=$Q(@x) Q:x="" Q:$NA(@x,$QL(y))'=y D L XZ Q ; L S g=x,d=@x I $G(disp) U 0 W !,g," = ",d I $G(set) S @g=d LZ Q ; DISP(x) ;Display only N disp,set S disp=1 D X(x) DISPZ Q ; SET(x) ;Set only N disp,set S set=1 D X(x) SETZ Q ; DSET(x) ;Display en Set N disp,set S (disp,set)=1 D X(x) DSETZ Q ; BGSET(r) ;Set reeks r in Background N i S r=$G(r) f i=1:1:$L(r,";") D SET($P(r,";",i)) BGSETZ Q ; KILL(x) ;Kill only S x=$G(x),$ZT="TRAP^"_$T(+0) Q:'$L(x) K @x KILLZ Q ; KILLS(x,y) ;Kill x and set y S x=$G(x),y=$G(y),$ZT="TRAP^"_$T(+0) D KILL(x),SET(y) KILLSZ Q ; KILLC(x,y) ;Check x and y ;Kill x and set y if different S x=$G(x),y=$G(y),$ZT="TRAP^"_$T(+0) S xx=$$CHECK^cQVGGLO(x),yy=$$CHECK^cQVGGLO(y),V=xx-yy I V D KILL(x),SET(y) KILLCZ Q ; KIA(x) ;Kill global in all namespaces N A,I,J,nspc,nspcn S x=$G(x) Q:'$L(x) S:$E(x)'="^" x="^"_x S nspc=$ZU(5) F I=1:1:99 S nspcn=$ZSTRIP(nspc,">N")_I I $ZU(90,10,nspcn) D . ZN nspcn D DB(x,.A) S J="" . ; switch to database to avoid -error . F S J=$O(A(J)) Q:J="" ZN "^^"_$P(A(J),"^",2) K @x . ZN nspc KIAZ Q ; BGKIA(r) ;Set reeks r in Background N i S r=$G(r) f i=1:1:$L(r,";") D KIA($P(r,";",i)) BGKIAZ Q ; SEA(x) ;Set global in all namespaces N I,nspc,nspcn S x=$G(x) Q:'$L(x) S nspc=$ZU(5) F I=1:1:99 S nspcn=$ZSTRIP(nspc,">N")_I I $ZU(90,10,nspcn) ZN nspcn D SET(x) ZN nspc SEAZ Q ; DB(%G,X) N %GL,I,J,K,SW K X Q:'$L(%G) S %G=$S($E(%G)'="^":"^"_%G,1:%G) Q:%G'?1"^"1A.E Q:'$D(@%G) S %GL=$E(%G,2,$L(%G)) S X(-1)=$$getdest^cQXLINF1($ZU(5),%GL) F I=0:1:9 S K=$$getdest^cQXLINF1($ZU(5),%GL,I) D . S J="",SW=0 F S J=$O(X(J)) Q:J="" I K=X(J) S SW=1 . Q:SW S X(I)=K DBZ Q ; TRAP I ($ZE["")!($ZE["") Q D ^cA400 TRAPZ Q ; ZZ ; 17.01.2012 - 15:58 * Cache-r6.4.9