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

DDGF.m

Go to the documentation of this file.
  1. DDGF ;SFISC/MKO-FORM BUILDING TOOL ;09DEC2015
  1. ;;22.2;VA FileMan;;Jan 05, 2016;Build 42
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
  1. ;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
  1. ;;Licensed under the terms of the Apache License, Version 2.0.
  1. ;
  1. ;Program-wide variables
  1. ; DDGFILE = File number^File name
  1. ; DDGFFM = Form number^Form name
  1. ; DDGFPG = Page number
  1. ; DDGFWID = Window id for given page
  1. ; DDGFWIDB = Window id for block displayer for a given page
  1. ; DDGFREF = Global reference where data is stored
  1. ; DDGFLIM = Boundaries within which cursor can be moved
  1. ; $Y1^$X1^$Y2^$X2
  1. ; DDGFBV = If defined, we're in the block view page
  1. ; DDGFMSG = Indicates there's a message on the message line.
  1. ;
  1. N %,%W,%X,%Y,C,D,D0,DI,DIC,DIEQ,DIW,DIZ,DQ,I,X,Y,DIOVRD
  1. I '$D(DIFM) N DIFM S DIFM=1 D INIZE^DIEFU
  1. D ^DDGF0 G:$G(DIERR) END^DDGF0
  1. D SEL^DDGFFM G:$D(DDGFFM)[0 END^DDGF0
  1. D ALL^DDGFASUB,^DDGF1,END^DDGF0
  1. Q
  1. ;
  1. REFRESH ;Repaint all windows, status line
  1. D REPALL^DDGLIBW(),STATUS
  1. Q
  1. ;
  1. STATUS ;Paint status line
  1. N DX,DY,N,S
  1. K DDGFMSG
  1. S DY=IOSL-7,DX=0 X IOXY
  1. W $P(DDGLCLR,DDGLDEL,3)_$TR($J("",IOM-1)," ","_")
  1. ;
  1. S DY=IOSL-6 X IOXY
  1. W "File: "_$P(DDGFFILE,U,2)_" (#"_$P(DDGFFILE,U)_")"
  1. I $D(DDGFBV)#2 S DX=46 X IOXY W "BLOCK VIEWER"
  1. W !,"Form: "_$P(DDGFFM,U,2)_" (#"_+DDGFFM_")"
  1. S N=$G(@DDGFREF@("F",+$G(DDGFPG)))
  1. W !,"Page: "_$S(N]"":$P(N,U,6)_" ("_$P(N,U,5)_")",1:""),!!!
  1. I $D(DDGFBV)#2 W $P(DDGLVID,DDGLDEL)_"<PF1>V=Main Screen <PF1>H=Help"_$P(DDGLVID,DDGLDEL,10)
  1. E W $P(DDGLVID,DDGLDEL)_"<PF1>Q=Quit <PF1>E=Exit <PF1>S=Save <PF1>V=Block Viewer <PF1>H=Help"_$P(DDGLVID,DDGLDEL,10)
  1. Q
  1. ;
  1. MSG(M) ;Print message
  1. N DDGFDY,DDGFDX
  1. S DDGFDY=DY,DDGFDX=DX S:$D(M)[0 M=""
  1. S DY=IOSL-2,DX=0 X IOXY
  1. ;
  1. W $E(M,1,79)_$P(DDGLCLR,DDGLDEL)
  1. S:M]"" DDGFMSG=1 K:M="" DDGFMSG
  1. S DY=DDGFDY,DX=DDGFDX X IOXY
  1. Q
  1. ;
  1. RESET ;Reset terminal and cleanup
  1. S DDGFREF="^TMP(""DDGF"",$J)",DDGLREF="^TMP(""DDGL"",$J)"
  1. K DDSFILE,DDSPAGE,DDSPARM,DR
  1. G KILL^DDGF0