LRWU2 ; IHS/DIR/FJE - UTILITY # 2 8/5/87 11:12 ;
;;5.2;LR;**1013**;JUL 15, 2002
;
;;5.2;LAB SERVICE;;Sep 27, 1994
RANGE ;call input in X, return loop in X9 index is T1
S X9=""
F I=1:1 Q:$P(X,",",I,99)="" S Y=$P(X,",",I) D RA2:Y["-" I +Y S X9=X9_","_+Y
S X9=$S($L(X9)>1:"F T1="_$E(X9,2,999)_" ",1:"") K J,K,Y Q
RA2 Q:Y<1 S J=+Y,K=+$P(Y,"-",2) I K<J S Y=K,K=J,J=Y
S X9=X9_","_J_":1:"_K,Y=0 Q
GROUP ;return a sub-group in X(I), Name of group in G1, Display group in G2(i), @G4 How to write G2(i), Other test executed in LREXEC
S:'$D(G4) G4="G2(I)"
GR1 W:$D(G1) !,G1 F I=0:0 S I=$O(G2(I)) Q:I'>0 W !,$J(I,5),?10,@G4
GR2 R !,"Enter Choice(s) :",G:DTIME I G="?" W !,"Enter a string of numbers separated with ',' or ' '.",!,"You may enter more than one line." G GR1
W ! G GREND:(G=""!(G="^")) S D=$S(G[",":",",1:" ")
F I=1:1 S X=$P(G,D,I) Q:X="" I $D(G2(X)) X:$D(LREXEC) LREXEC S:$D(X) X(X)=""
G GR2
GREND K I,G,D Q
LRWU2 ; IHS/DIR/FJE - UTILITY # 2 8/5/87 11:12 ;
+1 ;;5.2;LR;**1013**;JUL 15, 2002
+2 ;
+3 ;;5.2;LAB SERVICE;;Sep 27, 1994
RANGE ;call input in X, return loop in X9 index is T1
+1 SET X9=""
+2 FOR I=1:1
IF $PIECE(X,",",I,99)=""
QUIT
SET Y=$PIECE(X,",",I)
IF Y["-"
DO RA2
IF +Y
SET X9=X9_","_+Y
+3 SET X9=$SELECT($LENGTH(X9)>1:"F T1="_$EXTRACT(X9,2,999)_" ",1:"")
KILL J,K,Y
QUIT
RA2 IF Y<1
QUIT
SET J=+Y
SET K=+$PIECE(Y,"-",2)
IF K<J
SET Y=K
SET K=J
SET J=Y
+1 SET X9=X9_","_J_":1:"_K
SET Y=0
QUIT
GROUP ;return a sub-group in X(I), Name of group in G1, Display group in G2(i), @G4 How to write G2(i), Other test executed in LREXEC
+1 IF '$DATA(G4)
SET G4="G2(I)"
GR1 IF $DATA(G1)
WRITE !,G1
FOR I=0:0
SET I=$ORDER(G2(I))
IF I'>0
QUIT
WRITE !,$JUSTIFY(I,5),?10,@G4
GR2 READ !,"Enter Choice(s) :",G:DTIME
IF G="?"
WRITE !,"Enter a string of numbers separated with ',' or ' '.",!,"You may enter more than one line."
GOTO GR1
+1 WRITE !
IF (G=""!(G="^"))
GOTO GREND
SET D=$SELECT(G[",":",",1:" ")
+2 FOR I=1:1
SET X=$PIECE(G,D,I)
IF X=""
QUIT
IF $DATA(G2(X))
IF $DATA(LREXEC)
XECUTE LREXEC
IF $DATA(X)
SET X(X)=""
+3 GOTO GR2
GREND KILL I,G,D
QUIT