source: FOIAVistA/trunk/r/GEN_MED_REC_IO-GMRY/GMRYDIR.m@ 1203

Last change on this file since 1203 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.0 KB
Line 
1GMRYDIR ;HIRNFO/YH-REPLACE...WITH ;12/14/95
2 ;;4.0;Intake/Output;;Apr 25, 1997
3RW(STRING,LEN) ; Replace...With...
4 N X,Y,%,L S Y=STRING W !,STRING,! S:$D(DTIME)[0 DTIME=999
5A W:$X>75 ! W " Replace " R X:DTIME I '$T!(X["^") S GMROUT=1 G Q
6 G Q:X="",Q:X?1."^",Q:$E(X)=U&(Y'[X),C:X?."?",Q:X="@",E2:X="END"!(X="end")
7 I Y[X S D=X,L=$L(X) D H G:GMROUT Q S:'%&'GMROUT Y=$P(Y,D,1)_X_$P(Y,D,2,999) G A
8 S D=$P(X,"...",1),DH=$F(Y,D) I DH S X=$P(X,"...",2,99),X=$S(X="":$L(Y)+1,1:$F(Y,X,DH)) I X S DH=DH-$L(D)-1,D=X,L=D-DH-1 D H G:GMROUT Q S:'%&'GMROUT Y=$E(Y,1,DH)_X_$E(Y,D,999) G A
9 W $C(7)," ??" G A
10H W " With " R X:DTIME I '$T!(X["^") S GMROUT=1,X="",%=0 Q
11 S %=$L(Y)-L+$L(X)>LEN I % W $C(7),$S($L(Y)-L'>LEN:" String too long by "_($L(Y)-L+$L(X)-LEN)_" character(s)",X'=U:" String too long! '^' to quit",1:" ??") Q:$L(Y)-L>LEN&(X=U) G H
12 Q:X?.ANP W $C(7)," ??" G H
13E2 S L=0 D H G:GMROUT Q S:'%&'GMROUT Y=Y_X G A
14C W !,"Entry must be lesser than "_LEN_" characters",! G A
15B W:GMROUT *7 I STRING'=Y S X=Y W !?3 W X I X="" S X="@"
16Q W:'GMROUT !,Y,! Q Y
17 ;
Note: See TracBrowser for help on using the repository browser.