Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DDGLIB0

DDGLIB0.m

Go to the documentation of this file.
DDGLIB0 ;SFISC/MKO-SETUP AND CLEANUP FOR WINDOWS ;1:09 PM  19 Jun 1998
 ;;22.0;VA FileMan;;Mar 30, 1999
 ;Per VHA Directive 10-93-142, this routine should not be modified.
INIT() ;Setup required variables
 ;Set margin to 0
 ;Turn autowrap off
 ;Turn type-ahead on
 ;Variables set:
 ;  DDGLDEL  = delimiter for other DDGL variables
 ;  DDGLVID  = codes that turn on/off video attributes
 ;  DDGLED   = codes for editing
 ;  DDGLCLR  = codes to erase characters
 ;  DDGLGRA  = codes for graphics characters
 ;  DDGLZOSF = array of code from %ZOSF
 ;  DDGLREF  = global where window image is stored
 ;  DDGLKEY  = codes for non-alphanumeric keys
 ;  DDGLSCR  = array containing list of visible windows on screen
 ;
 N X
 I $D(DDGLDEL)[0 D SET Q:$G(DIERR)
 S X=0 X ^%ZOSF("RM"),^("TYPE-AHEAD")
 W $P(DDGLVID,DDGLDEL,8)
 Q
 ;
SET ;Setup screen handling variables
 K DIERR,DDGLSCR
 S U="^",DDGLDEL=$C(127)
 ;
 F X="EOFF","EON","TRMOFF","TRMON","TRMRD" D  G:$G(DIERR) ABT
 . I $D(^%ZOSF(X))#2 S DDGLZOSF(X)=^(X) Q
 . D BLD^DIALOG(810)
 ;
 S IOP="HOME" D ^%ZIS I POP D BLD^DIALOG(845) G ABT
 I $D(^%ZIS(2)),'$O(^%ZIS(2,+$G(IOST(0)),0)) D BLD^DIALOG(840,"#"_+$G(IOST(0))) G ABT
 ;
 D:$G(IOXY)="" TRMERR("Cursor positioning (XY CRT)")
 ;
 S X="IORVON;IORVOFF;IOELEOL;IOEDEOP;IOUON;IOUOFF;IOSGR0;IOINHI;IOINLOW;IOINORM;IOCUU;IOCUD;IOCUF;IOCUB;IODL;IOIL;IODCH;IOICH;IOEDALL;IOELALL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 ;
 D:$P(DDGLKEY,U,1,5)_U[(U_U) TRMERR("Cursor keys")
 D:U_$P(DDGLKEY,U,6,9)_U[(U_U) TRMERR("PF keys")
 D:IOELEOL="" TRMERR("Erase to End of Line")
 D:IOEDALL="" TRMERR("Erase Entire Page")
 D:IOEDEOP="" TRMERR("Erase to End of Page")
 G:$G(DIERR) ABT
 ;
 S DDGLREF="^TMP(""DDGL"",$J,""W"")" K @DDGLREF
 ;
 I "^C-QUME^C-QVT102^C-WYSE75^"[(U_$TR(IOST," ","")_U) D
 . S DDGLVAN=1
 . 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)
 . S $P(DDGLVID,DDGLDEL,10)=IOINORM
 ;
 D:'$D(^%ZTSK)!($D(^%ZOSF("MGR"))[0) KILL^%ZISS
 Q
 ;
TRMERR(DDGLCH) ;Terminal type errors
 N P
 S P(1)=DDGLCH,P(2)=IOST
 D BLD^DIALOG(842,.P)
 Q
 ;
KILL(DDGLPARM) ;Cleanup variables
 ;Set margin to IOM
 ;Turn off type-ahead if New Person file so indicates
 ;Turn autowrap on
 ;Reset character attributes
 ;Turn echo on
 ;Turn terminators off
 N X
 I $G(DDGLPARM)'["W" D
 . S X=$S($D(IOM)#2:IOM,1:80) X $G(^%ZOSF("RM"))
 . I $D(DUZ)#2,$D(^VA(200,DUZ,0))#2,$P($G(^(200)),U,9)'="Y" D
 .. I '$G(DUZ("BUF"),1) X $G(^%ZOSF("NO-TYPE-AHEAD"))
 . W $P($G(DDGLVID),$G(DDGLDEL),9),$P($G(DDGLVID),$G(DDGLDEL),10)
 ;
 I $G(DDGLPARM)'["T" D
 . X $G(DDGLZOSF("EON")),$G(DDGLZOSF("TRMOFF"))
 E  X $G(DDGLZOSF("EOFF")),$G(DDGLZOSF("TRMON"))
 ;
ABT K DX,DY,POP
 I '$G(DIERR),$G(DDGLPARM)["K" Q
 K:$G(DDGLREF)]"" @DDGLREF
 D:'$D(^%ZTSK)!($D(^%ZOSF("MGR"))[0) KILL^%ZISS
 ;
 K DDGLDEL,DDGLVID,DDGLED,DDGLCLR,DDGLGRA,DDGLZOSF,DDGLREF
 K DDGLKEY,DDGLSCR,DDGLVAN,DDGLH
 ;
 K DIR0
 Q