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

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

initial load of WorldVistAEHR

File size: 3.9 KB
Line 
1DDGLIB0 ;SFISC/MKO-SETUP AND CLEANUP FOR WINDOWS ;1:09 PM 19 Jun 1998
2 ;;22.0;VA FileMan;;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4INIT() ;Setup required variables
5 ;Set margin to 0
6 ;Turn autowrap off
7 ;Turn type-ahead on
8 ;Variables set:
9 ; DDGLDEL = delimiter for other DDGL variables
10 ; DDGLVID = codes that turn on/off video attributes
11 ; DDGLED = codes for editing
12 ; DDGLCLR = codes to erase characters
13 ; DDGLGRA = codes for graphics characters
14 ; DDGLZOSF = array of code from %ZOSF
15 ; DDGLREF = global where window image is stored
16 ; DDGLKEY = codes for non-alphanumeric keys
17 ; DDGLSCR = array containing list of visible windows on screen
18 ;
19 N X
20 I $D(DDGLDEL)[0 D SET Q:$G(DIERR)
21 S X=0 X ^%ZOSF("RM"),^("TYPE-AHEAD")
22 W $P(DDGLVID,DDGLDEL,8)
23 Q
24 ;
25SET ;Setup screen handling variables
26 K DIERR,DDGLSCR
27 S U="^",DDGLDEL=$C(127)
28 ;
29 F X="EOFF","EON","TRMOFF","TRMON","TRMRD" D G:$G(DIERR) ABT
30 . I $D(^%ZOSF(X))#2 S DDGLZOSF(X)=^(X) Q
31 . D BLD^DIALOG(810)
32 ;
33 S IOP="HOME" D ^%ZIS I POP D BLD^DIALOG(845) G ABT
34 I $D(^%ZIS(2)),'$O(^%ZIS(2,+$G(IOST(0)),0)) D BLD^DIALOG(840,"#"_+$G(IOST(0))) G ABT
35 ;
36 D:$G(IOXY)="" TRMERR("Cursor positioning (XY CRT)")
37 ;
38 S X="IORVON;IORVOFF;IOELEOL;IOEDEOP;IOUON;IOUOFF;IOSGR0;IOINHI;IOINLOW;IOINORM;IOCUU;IO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DDGLDEL_"|"_DDGLDEL_"+"_DDGLDEL_"+"_DDGLDEL_"+"_DDGLDEL_"+"
52 ;
53 D:$P(DDGLKEY,U,1,5)_U[(U_U) TRMERR("Cursor keys")
54 D:U_$P(DDGLKEY,U,6,9)_U[(U_U) TRMERR("PF keys")
55 D:IOELEOL="" TRMERR("Erase to End of Line")
56 D:IOEDALL="" TRMERR("Erase Entire Page")
57 D:IOEDEOP="" TRMERR("Erase to End of Page")
58 G:$G(DIERR) ABT
59 ;
60 S DDGLREF="^TMP(""DDGL"",$J,""W"")" K @DDGLREF
61 ;
62 I "^C-QUME^C-QVT102^C-WYSE75^"[(U_$TR(IOST," ","")_U) D
63 . S DDGLVAN=1
64 . S $P(DDGLVID,DDGLDEL,4,7)=$S($TR(IOST," ","")="C-WYSE75":IOINHI_DDGLDEL_IOINLOW_DDGLDEL_IOINHI_DDGLDEL_IOINLOW,1:IOINLOW_DDGLDEL_IOINHI_DDGLDEL_IOINLOW_DDGLDEL_IOINHI)
65 . S $P(DDGLVID,DDGLDEL,10)=IOINORM
66 ;
67 D:'$D(^%ZTSK)!($D(^%ZOSF("MGR"))[0) KILL^%ZISS
68 Q
69 ;
70TRMERR(DDGLCH) ;Terminal type errors
71 N P
72 S P(1)=DDGLCH,P(2)=IOST
73 D BLD^DIALOG(842,.P)
74 Q
75 ;
76KILL(DDGLPARM) ;Cleanup variables
77 ;Set margin to IOM
78 ;Turn off type-ahead if New Person file so indicates
79 ;Turn autowrap on
80 ;Reset character attributes
81 ;Turn echo on
82 ;Turn terminators off
83 N X
84 I $G(DDGLPARM)'["W" D
85 . S X=$S($D(IOM)#2:IOM,1:80) X $G(^%ZOSF("RM"))
86 . I $D(DUZ)#2,$D(^VA(200,DUZ,0))#2,$P($G(^(200)),U,9)'="Y" D
87 .. I '$G(DUZ("BUF"),1) X $G(^%ZOSF("NO-TYPE-AHEAD"))
88 . W $P($G(DDGLVID),$G(DDGLDEL),9),$P($G(DDGLVID),$G(DDGLDEL),10)
89 ;
90 I $G(DDGLPARM)'["T" D
91 . X $G(DDGLZOSF("EON")),$G(DDGLZOSF("TRMOFF"))
92 E X $G(DDGLZOSF("EOFF")),$G(DDGLZOSF("TRMON"))
93 ;
94ABT K DX,DY,POP
95 I '$G(DIERR),$G(DDGLPARM)["K" Q
96 K:$G(DDGLREF)]"" @DDGLREF
97 D:'$D(^%ZTSK)!($D(^%ZOSF("MGR"))[0) KILL^%ZISS
98 ;
99 K DDGLDEL,DDGLVID,DDGLED,DDGLCLR,DDGLGRA,DDGLZOSF,DDGLREF
100 K DDGLKEY,DDGLSCR,DDGLVAN,DDGLH
101 ;
102 K DIR0
103 Q
Note: See TracBrowser for help on using the repository browser.