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

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

initial load of WorldVistAEHR

File size: 4.7 KB
RevLine 
[613]1DDGLIBH ;SFISC/MKO-SCREEN EDITOR HELP ;08:00 AM 23 Feb 1995
2 ;;22.0;VA FileMan;;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5HLP(DDGLHN1,DDGLHN2,DDGLSUB,DDGLPLN) ;
6 ;DDGLHN1 = Entry number in Dialog file of first help screen
7 ;DDGLHN2 = Entry number of last help screen
8 ;DDGLSUB = Subscript in ^TMP to copy help to
9 ;DDGLPLN = $Y to print prompt
10 ;
11 N DX,DY,DDGLI,DDGLJ,DDGLSC,DDGLTX,DDGLX,DIHELP,DDGL0
12 S DDGL0=$C(31)
13 D:'$D(DDGLH) GETKEY
14 I $D(IOTM)[0 N IOTM S IOTM=1
15 I $D(IOBM)[0 N IOBM S IOBM=IOSL
16 I '$G(DDGLPLN) S DDGLPLN=IOBM-1
17 S DDGLSC=DDGLHN1
18 ;
19 D DISP(DDGLHN1)
20 ;
21 F S DDGLX=$$READ D @DDGLX Q:DDGLX=U
22 Q
23 ;
24UP I DDGLSC>DDGLHN1 S DDGLSC=DDGLSC-1 D DISP(DDGLSC)
25 Q
26 ;
27DN I DDGLSC<DDGLHN2 S DDGLSC=DDGLSC+1 D DISP(DDGLSC)
28 Q
29 ;
30TO W $C(7)
31QT S DDGLX=U
32 Q
33 ;
34PT ;Prompt for device and print
35 ;Clear screen
36 N POP
37 N %,%A,%B,%B1,%B2,%B3,%BA,%C,%E,%G,%H,%I,%J,%K,%M,%N
38 N %P,%S,%T,%W,%X,%Y
39 N %A0,%D1,%D2,%DT,%J1,%W0
40 ;
41 S DY=IOTM-1,DX=0 X IOXY
42 W $P(DDGLVID,DDGLDEL)_"PRINT THE HELP SCREENS"_$P(DDGLVID,DDGLDEL,10)_$P(DDGLCLR,DDGLDEL)
43 F DDGLI=1:1:IOBM-IOTM W $C(13,10)_$P(DDGLCLR,DDGLDEL)
44 S DY=IOTM+1,DX=0 X IOXY
45 ;
46 X DDGLZOSF("EON"),DDGLZOSF("TRMOFF")
47 S X=$G(IOM,80) X ^%ZOSF("RM")
48 W $P(DDGLVID,DDGLDEL,9)
49 ;
50DEVICE ;Device prompt
51 N IOF,IOSL
52 S IOF="#",IOSL=IOBM-IOTM+1 ;In case help frames are invoked
53 S %ZIS=$S($D(^%ZTSK):"Q",1:""),%ZIS("B")=""
54 D ^%ZIS K %ZIS
55 ;
56 I POP D
57 . W !!,"Report canceled!"
58 . H 2
59 ;
60 ;Queue report
61 E I $D(IO("Q")),$D(^%ZTSK) D
62 . S ZTRTN="PRINT^DDGLIBH"
63 . S ZTDESC="Help screen printout."
64 . N I F I="DDGLHN1","DDGLHN2" S ZTSAVE(I)=""
65 . D ^%ZTLOAD
66 . I $D(ZTSK)#2 W !,"Report queued!",!,"Task number: "_ZTSK,!
67 . E W !,"Report canceled!",!
68 . K ZTSK
69 . S IOP="HOME" D ^%ZIS
70 ;
71 E I $E(IOST,1,2)="C-" D G DEVICE
72 . W !,$C(7)_"You cannot print the help screens on a CRT.",!
73 ;
74 ;Non-queued report
75 E D
76 . W !,"Printing ..."
77 . U IO
78 . D PRINT
79 . X $G(^%ZIS("C"))
80 ;
81 ;Repaint help screen
82 X DDGLZOSF("EOFF"),DDGLZOSF("TRMON")
83 S X=0 X ^%ZOSF("RM")
84 W $P(DDGLVID,DDGLDEL,8)
85 D DISP(DDGLSC)
86 Q
87 ;
88PRINT ;
89 N DDGLJ,DDGLL,DDGLP
90 F DDGLI=DDGLHN1:1:DDGLHN2 D
91 . I DDGLI'=DDGLHN1 D
92 .. I $Y+$O(^DI(.84,DDGLI,2," "),-1)+2'<IOSL W @IOF
93 .. E W !!
94 . S DDGLJ=0
95 . F S DDGLJ=$O(^DI(.84,DDGLI,2,DDGLJ)) Q:'DDGLJ D
96 .. S DDGLL=$G(^DI(.84,DDGLI,2,DDGLJ,0))
97 .. F Q:DDGLL'["\" D
98 ... S DDGLP=$F(DDGLL,"\") Q:$E(DDGLL,DDGLP)="\"
99 ... S $E(DDGLL,DDGLP-1,DDGLP)=""
100 .. W !,DDGLL
101 ;
102 S:$D(ZTQUEUED) ZTREQ="@"
103 Q
104 ;
105DISP(DDGLHN) ;Print help screen DDGLHN
106 N DDGLHARR
107 S DDGLHARR=$NA(^TMP(DDGLSUB,$J,DDGLHN))
108 D:'$D(@DDGLHARR) BLD^DIALOG(DDGLHN,"","",DDGLHARR)
109 ;
110 S DY=IOTM-1,DX=0 X IOXY
111 F DDGLI=1:1 Q:'$D(@DDGLHARR@(DDGLI)) S DDGLTX=^(DDGLI) D
112 . I DDGLTX["\B" F S DDGLJ=$F(DDGLTX,"\B") Q:'DDGLJ D
113 .. S $E(DDGLTX,DDGLJ-2,DDGLJ-1)=$P(DDGLVID,DDGLDEL)
114 . I DDGLTX["\n" F S DDGLJ=$F(DDGLTX,"\n") Q:'DDGLJ D
115 .. S $E(DDGLTX,DDGLJ-2,DDGLJ-1)=$P(DDGLVID,DDGLDEL,10)
116 . W $S(DDGLI>1:$C(13,10),1:"")_DDGLTX_$P(DDGLCLR,DDGLDEL)
117 ;
118 F DDGLI=DDGLI:1:IOBM-IOTM+1 W $C(13,10)_$P(DDGLCLR,DDGLDEL)
119 Q
120 ;
121READ() ;
122 S DY=DDGLPLN,DX=0 X IOXY
123 W $P(DDGLCLR,DDGLDEL)_"Press "
124 W:DDGLSC>DDGLHN1 $P(DDGLVID,DDGLDEL)_"<Up>"_$P(DDGLVID,DDGLDEL,10)_" for previous page, "
125 W:DDGLSC<DDGLHN2 $P(DDGLVID,DDGLDEL)_"<Down>"_$P(DDGLVID,DDGLDEL,10)_" for next page, "
126 W $P(DDGLVID,DDGLDEL)_"P"_$P(DDGLVID,DDGLDEL,10)_" to print, "
127 W $P(DDGLVID,DDGLDEL)_"^"_$P(DDGLVID,DDGLDEL,10)_" to exit: "
128 D GETCH(DTIME,.DDGLX)
129 S DY=DDGLPLN,DX=0 X IOXY W $P(DDGLCLR,DDGLDEL)
130 Q DDGLX
131 ;
132GETCH(DTIME,Y) ;Out: Y = Mnemonic
133 F D Q:Y'=-1
134 . R *Y:DTIME
135 . I Y<0 S Y="TO" Q
136 . D MNE(.Y)
137 Q
138 ;
139MNE(Y) ;Out: Y = Mnemonic, or -1 if invalid
140 N S,F
141 S S="",F=0
142 F D MNELOOP Q:F
143 Q
144 ;
145MNELOOP ;Read more
146 S S=S_$C(Y)
147 I DDGLH("IN")'[(DDGL0_S) D I Y=-1 D FLUSH Q
148 . I $C(Y)'?1L S Y=-1 Q
149 . S S=$E(S,1,$L(S)-1)_$C(Y-32)
150 . S:DDGLH("IN")'[(DDGL0_S_DDGL0) Y=-1
151 ;
152 I DDGLH("IN")[(DDGL0_S_DDGL0),S'=$C(27) D Q
153 . S Y=$P(DDGLH("OUT"),DDGL0,$L($P(DDGLH("IN"),DDGL0_S_DDGL0),DDGL0)),F=1
154 ;
155 R *Y:5 D:Y=-1 FLUSH
156 Q
157 ;
158FLUSH ;
159 N DDGLZ
160 S F=1 W $C(7) F R *DDGLZ:0 E Q
161 Q
162 ;
163GETKEY ;Get key sequences and defaults
164 N AU,AD,F1,PREVSC,NEXTSC
165 N I,K,N,T
166 S AU=$P(DDGLKEY,U,2)
167 S AD=$P(DDGLKEY,U,3)
168 S F1=$P(DDGLKEY,U,6)
169 S PREVSC=$P(DDGLKEY,U,14)
170 S NEXTSC=$P(DDGLKEY,U,15)
171 ;
172 K DDGLH
173 S DDGLH("IN")="",DDGLH("OUT")=""
174 F I=1:1 S T=$P($T(MAP+I),";;",2,999) Q:T="" D
175 . S @("K="_$P(T,";",2))
176 . I DDGLH("IN")'[(DDGL0_K),K]"" D
177 .. S DDGLH("IN")=DDGLH("IN")_DDGL0_K
178 .. S DDGLH("OUT")=DDGLH("OUT")_$P(T,";")_DDGL0
179 S DDGLH("IN")=DDGLH("IN")_DDGL0
180 S DDGLH("OUT")=$E(DDGLH("OUT"),1,$L(DDGLH("OUT"))-1)
181 Q
182 ;
183MAP ;Keys
184 ;;DN;$C(13)
185 ;;DN;AD
186 ;;DN;F1_AD
187 ;;DN;NEXTSC
188 ;;UP;AU
189 ;;UP;F1_AU
190 ;;UP;PREVSC
191 ;;QT;F1_"E"
192 ;;QT;F1_"Q"
193 ;;QT;"^"
194 ;;PT;"P"
Note: See TracBrowser for help on using the repository browser.