cQVGGLS ;CHECK GLOBAL INDEXED ;cQVGGLS; ; W !,"Usage: S E=$$C^",$T(+0),"(G,L,V)" W !," Calculate checksum for global G on level L, return result in Variable V." W !," Only the nodes with at least L indices will be checked." W !," I E=0 then an error occurred or the are no L levels!",! W !," ex.: D C^",$T(+0),"(""^INDEX"",2)" W !," will check the nodes of ^INDEX which have 2 indices or more" W !," ^INDEX(0) will NOT be checked" W !," ^INDEX(0,x) and ^INDEX(0,x,...) will be checked" Q ; C(G,L,X) ;Check global G for L Levels, result in X S G=$G(G),L=$G(L,0) I '$L(G) Q 0 N I K X I $E(G)'="^" S G="^"_G I L=0 D A(G) Q 1 D D(G) I $D(X) Q 1 CZ Q 0 ; D(G) S G=$G(G) N J S J="" I $E(G)'="^" S G="^"_G F S J=$O(@G@(J)) Q:J="" S GG=$ZR D . I $QL(GG)=L D A(GG) Q . D D(GG) DZ Q ; A(G) S X(G)=$$CHECK^cQVGGLO(G)_"\"_$P(%C,"#",1)_"\"_$P(%C,"#",2)_"\"_%tu_"\"_%tur AZ Q ; YZ Q ; ZZ ; 17.01.2012 - 15:58 * Cache-r6.4.9