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

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

initial load of WorldVistAEHR

File size: 2.4 KB
RevLine 
[613]1DIWE12 ;SFISC/XAK,RWF-WORD PROCESSING CHANGE EDITORS ;11:21 AM 5 Mar 1999
2 ;;22.0;VA FileMan;;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 Q:$D(DIWE(1)) S DIWE(1)=DIWE D 1 K DIWE(1) Q
5 ;
61 I '$D(DIWE(9)) D ASK G QX:U[X
72 S DIWE=DIWE(9) K DIWE(9) I $D(DIWE(1)),DIWE=DIWE(1) K DIWE(1) Q
8OPT S DIWE(5)=$G(^DIST(1.2,DIWE,2)) I DIWE(5)]"" X DIWE(5) I '$T S:$D(DIWE(2)) DIWE(9)=1 G 1 ;Not valid
9 Q:$D(DTOUT) S @(DIC_"0)")=DWLC,DIWE(0)=$S($D(^DIST(1.2,DIWE,1)):^(1),1:"") I $G(DIWE)=1!$D(DDS)!$D(DIWE(1))!($G(DWPK)'="FM"&($D(DIWEPSE)[0)) X DIWE(0) G QQ
10 K DIR I $G(DWPK)'="FM" S DIR(0)="E"
11 E D
12 . N I,J
13 . W:'DWLC !,$J("",$G(DL)*2)_"No existing text"
14 . I DWLC S I=DWLC,J=$S(I<11:1,1:I-8) W:J>1 ?7,". . .",!?7,". . ." X "F J=J:1:I W !,"_DIC_"J,0)" W !
15 . S DIR(0)="Y",DIR("A")=$J("",$G(DL)*2)_"Edit",DIR("B")="NO",DIR("?",1)=" Enter 'YES' if you wish to go into the editor.",DIR("?")=" Enter 'NO' if you do not wish to edit at this time."
16 . Q
17 D ^DIR K DIR I '$D(DIRUT),Y=1 X DIWE(0)
18QQ K DIWEPSE,DUOUT I $D(DIWE(1)) S DIWE=DIWE(1),DIWE(5)=$G(^DIST(1.2,DIWE,3)) X:DIWE(5)]"" DIWE(5)
19QX K DWOU I $D(DIWESW) K DIWESW G:'$D(DIWE(1)) 1
20 D:$D(DIWE(2)) X^DIWE Q
21 ;
22ASK R !,"Select ALTERNATE EDITOR: ",X:DTIME S:'$T DTOUT=1,X=U G AQ:U[X!(X=".")
23 I X'?.UNP S X=$TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
24 S Y=X I X?1U.ANP,'$D(^DIST(1.2,"B",X)) S X=$O(^(X)) S:$E(X,1,$L(Y))'=Y X="?"
25 S J="^DIST(1.2," I X?1U.UNP S I=$O(^DIST(1.2,"B",X,0)) I I>0 S ^DISV(DUZ,J)=I,DIWE(9)=I W $P(X,Y,2) G AX
26 I X=" ",$D(^DISV(DUZ,J)) S I=^(J) I $D(^DIST(1.2,I,0))#2 S DIWE(9)=I,X=$P(^(0),U,1) W X G AX
27 W !?5,"Choose an Alternate Editor"
28 I X?2"?".E W " from the following:" S Y="" F I=0:0 S Y=$O(^DIST(1.2,"B",Y)) Q:Y']"" S DIWE=+$O(^(Y,0)),DIWE(5)=$G(^DIST(1.2,DIWE,2)) I 1 X:DIWE(5)]"" DIWE(5) I $T W !?10,Y
29 G ASK
30AQ S X=U
31AX Q
32 ;
33 ;DIC is the root of the where the text is located.
34 ;DWLC is the line count, must be updated by the editor.
35 ;The @(DIC_"0)") node will be updated by DIWE on exit.
36 ;Variables not to be changed:
37 ;DWHD,DIWPT,DWO,DWLR,DWL,DWPK,DWAFT,DIWE
38 ;DIWE = Pointer to current editor
39 ;DIWE(0) = Calling code
40 ;DIWE(1) = if $D Called from this editor, will return at end.
41 ;DIWE(2) = if $D Flag to say prefered editor not R/W used in exit.
42 ;DIWE(5) = if $D Other execute code for OK TO RUN, RETURN TO CALLING
43 ;DIWE(9) = if $D then entry number of editor to switch to.
Note: See TracBrowser for help on using the repository browser.