source: WorldVistAEHR/trunk/r/VA_FILEMAN-ARJT-DI-DD-DM-DT-%DT-%RCR/DIWE1.m@ 792

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

revised back to 6/30/08 version

File size: 2.9 KB
RevLine 
[623]1DIWE1 ;SFISC/GFT-WORD PROCESSING FUNCTION ;7/29/94 09:18
2 ;;22.0;VA FileMan;;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 G X:$D(DTOUT) I '$D(DWL) S I=DWLC,J=$S(I<11:1,1:I-8) W:J>1 ?7,". . .",!?7,". . ." D LL
51 G X:$D(DTOUT) R !,"EDIT Option: ",X:DTIME S:'$T DTOUT=1 G X:U[X!(X=".")
6LC I X?1L S X=$C($A(X)-32)
7 S J="^DOPT(""DIWE1""," I X?1U S I=$F(DWO,X)-1 I I>0 S ^DISV(DUZ,J)=I S I=I*2-1 G OPT
8 I X=" ",$D(^DISV(DUZ,J)) S I=^(J),X=$E(DWO,I) I X]"" W X S I=I*2-1 G OPT
9 I X?1N.N S I=9 D LN G E2:X W "OR"
10 W !?5,"Choose, by first letter, a Word Processing Command"
11 I X?2"?".E W " from the following:" F I=1:2 S Y=$T(OPT+I),J=$E(Y,1) Q:J=" " I DWO[J W !?10,$P(Y,";",4)
12 W !?5,"or type a Line Number to edit that line." G 1
13 ;
14OPT Q:$D(DTOUT) S X1=$T(OPT+I),X=$P(X1,";",3) W $E(X,'$X)_$E(X,2,99) G @$E(X1,1)
15A ;;Add lines;Add Lines to End of Text
16 D ^DIWE2 S (DWL,DWLC)=DWI,@(DIC_"0)=DWLC") G 1:DWLC,X
17B ;;Break line: ;Break a Line into Two;
18 D RD G B^DIWE4
19C ;;Change every: ;Change Every String to Another in a Range of Lines;
20 G C^DIWE2
21D ;;Delete from line: ;Delete Line(s);
22 D RD G D^DIWE3
23E ;;Edit line: ;Edit a Line (Replace __ With __);
24 D RD G OPT:X="",1:X=U,LC:X?1A,E2
25G ;;Get Data from Another Source ;Get Data from Another Source
26 G X^DIWE5
27I ;;Insert after line: ;Insert Line(s) after an Existing Line;
28 D RD G I^DIWE2
29J ;;Join line: ;Join Line to the One Following;
30 D RD G J^DIWE4
31L ;;List line: ;List a Range of Lines;
32 S DIWELAST=$S($G(DIWELAST):DIWELAST,1:1) W DIWELAST_"//" R X:DTIME S:'$T X=U,DTOUT=1 S:X="" X=DIWELAST D LN G LIST:X,1:X=U W !,$P(X1,";",3) G L
33M ;;Move line: ;Move Lines to New Location within Text;
34 D RD G M^DIWE3
35P ;;Print from Line: 1//;Print Lines as Formatted Output;
36 R X:DTIME S:'$T X=U,DTOUT=1 S:X="" X=1 D LN,^DIWE4:X G 1
37R ;;Repeat line: ;Repeat Lines at a New Location
38 D RD G R^DIWE3
39S ;;Search for: ;Search for a String
40 G S^DIWE2
41T ;;Transfer incoming text after line: ;Transfer Lines From Another Document
42 D RD,Z^DIWE3 G DIWE1
43U ;;Utilities in Word-Processing;Utility Sub-Menu
44 D ^DIWE11 G 1
45Y ;;Y;Y-Programmer Edit;
46 G Y^DIWE4
47 ;;
48E2 S Y=^(0) S:Y="" Y=" " W !,$J(DWL,3)_">"_Y,! S DIRWP=1 D RW^DIR2 K DIRWP G E2:X?1."?",X:X?1."^"
49TAB I X[$C(9) S X=$P(X,$C(9),1)_$C(124)_"TAB"_$C(124)_$P(X,$C(9),2,999) G TAB
50 S:X]"" ^(0)=X I X="@" S (DW1,DW2)=DWL W "DELETED..." D DEL^DIWE3
51 W ! S I=9 G OPT
52 ;
53RD R X:DTIME S:'$T DTOUT=1 I X?1."?" W !?5,"Enter a line number from 1 through "_DWLC,!!,$P(X1,";",3) G RD
54LN I U[X!(X=".") S X=U Q
55 Q:I=9&(X?1A) I 'DWLC,I<27,I-13 S X=U W " THERE ARE NO LINES!",$C(7),! Q
56 I "+- "[$E(X,1),X?1P.N,$D(DWL) S:X?1P X=X_1 S X=X+DWL W " "_X
57 E S X=+X
58 I (I=13!(I=27)&(X=0))!$D(@(DIC_"X,0)")) S DWL=X Q
59 S X="" G LNQ^DIWE5
60 ;
61X K DIWELAST
62 G X^DIWE
63 ;
64LIST W " to: "_DWLC_"// " R I:DTIME S:'$T DTOUT=1 S I=$S(I="":DWLC,1:I) I I,I>DWLC!(I<1) S I=DWLC
65 S J=X,DIWELAST=$S(DWLC=I:1,1:I) D LL G 1
66LL X "F J=J:1:I W !,$J(J,3)_"">""_"_DIC_"J,0)"
Note: See TracBrowser for help on using the repository browser.