XTVCHG ;SF-ISC/RWF - VARIABLE CHANGER ;2/3/93 13:45 ;
;;7.3;TOOLKIT;;Apr 25, 1995
W !,"VARIABLE CHANGER" K ^TMP($J) X ^%ZOSF("RSEL") Q:$O(^UTILITY($J,0))="" S %X="^UTILITY($J,",%Y="^TMP($J," D %XY^%RCR K ^UTILITY($J)
F I=1:1 S X=$T(Z+I) Q:X="" S @("X"_I)=$P(X,";;",2)
LOOP R !,"VARIABLE TO CHANGE: ",V1:999 Q:V1["^"!(V1="") R " CHANGE TO: ",V2:999 G LOOP:V2="" Q:V2["^"
S RN=0,X=" ,'_&![]<>:=-+/\*",G2=X_"()@",G1=X_"(",NL="",L1=$L(V1)
X "F I2=0:0 S RN=$O(^TMP($J,RN)) Q:RN=NL ZL @RN W:$X>70 ! W $J(RN,10) S CH=0 X X1 I CH ZS @RN W !"
W !,"* DONE CHANGING ",V1," TO ",V2 G LOOP
Z ;
;;X X3 F I1=1:1 S L=$T(+I1),C=0 Q:L=NL I L[V1 X X2 I C ZR +I1 ZI L W !,L S CH=1
;;F I=1:0 S I=$F(L,V1,I) Q:I<1 I $A(L,I-L1-1)>0,G1[$E(L,I-L1-1),G2[$E(L,I) S L=$E(L,1,I-L1-1)_V2_$E(L,I,999),C=1,I=I-1
;;I $T(@V1)'=NL W !,"The variable ",V1," is used as a line label and DO or GOTO may be changed.",$C(7)
XTVCHG ;SF-ISC/RWF - VARIABLE CHANGER ;2/3/93 13:45 ;
+1 ;;7.3;TOOLKIT;;Apr 25, 1995
+2 WRITE !,"VARIABLE CHANGER"
KILL ^TMP($JOB)
XECUTE ^%ZOSF("RSEL")
IF $ORDER(^UTILITY($JOB,0))=""
QUIT
SET %X="^UTILITY($J,"
SET %Y="^TMP($J,"
DO %XY^%RCR
KILL ^UTILITY($JOB)
+3 FOR I=1:1
SET X=$TEXT(Z+I)
IF X=""
QUIT
SET @("X"_I)=$PIECE(X,";;",2)
LOOP READ !,"VARIABLE TO CHANGE: ",V1:999
IF V1["^"!(V1="")
QUIT
READ " CHANGE TO: ",V2:999
IF V2=""
GOTO LOOP
IF V2["^"
QUIT
+1 SET RN=0
SET X=" ,'_&![]<>:=-+/\*"
SET G2=X_"()@"
SET G1=X_"("
SET NL=""
SET L1=$LENGTH(V1)
+2 XECUTE "F I2=0:0 S RN=$O(^TMP($J,RN)) Q:RN=NL ZL @RN W:$X>70 ! W $J(RN,10) S CH=0 X X1 I CH ZS @RN W !"
+3 WRITE !,"* DONE CHANGING ",V1," TO ",V2
GOTO LOOP
Z ;
+1 ;;X X3 F I1=1:1 S L=$T(+I1),C=0 Q:L=NL I L[V1 X X2 I C ZR +I1 ZI L W !,L S CH=1
+2 ;;F I=1:0 S I=$F(L,V1,I) Q:I<1 I $A(L,I-L1-1)>0,G1[$E(L,I-L1-1),G2[$E(L,I) S L=$E(L,1,I-L1-1)_V2_$E(L,I,999),C=1,I=I-1
+3 ;;I $T(@V1)'=NL W !,"The variable ",V1," is used as a line label and DO or GOTO may be changed.",$C(7)