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

DVBAUTL4.m

Go to the documentation of this file.
  1. DVBAUTL4 ;ALB/JLU;UTILITY ROUTINE;9/9/94
  1. ;;2.7;AMIE;**28**;Apr 10, 1995
  1. ;
  1. WR(TEXT) ;
  1. ;this is the main entry point for the AMIE writer
  1. ;the following is a desciption of how to set up the text string to use
  1. ;this call.
  1. ;The first uparrow piece contians the description of what to execute
  1. ;on this line. The second peice contians the actual line of text.
  1. ;The descriptions are defined below
  1. ;1st = contains a 1 or zero 1 for beep zero no beep
  1. ;2nd = contains the number of spaces before and/or after the text 1:1
  1. ;3rd = contains the number of tabs before and/or after the text 1:2
  1. ;4th = contains the number of lines before and/or after the text 1:4
  1. ;5th = contains the number of form feeds before and/or after the
  1. ; text 1:3
  1. ;TEXT = contains the array that holds the text to be displayed
  1. ; the array is to look like ARRAY(X,0) local or global
  1. ; The X must start at one and be in consecutive order.
  1. ;The data in each array element will look like. "0,1:1,1:2,1:4,1:3^text"
  1. ;
  1. F LP=1:1 S TEXTM=$G(@TEXT@(LP,0)) Q:TEXTM="" DO
  1. .D SETTEXT
  1. .D SETVAR
  1. .I TEXT2="",SPACE="",TAB="",LINE="",FORM="",BEEP="" Q
  1. .I $G(IO)'="" U IO
  1. .I TEXT2="" D SHORT
  1. .I TEXT2]"" D BODY
  1. .Q
  1. D EXIT
  1. Q
  1. ;
  1. EXIT K TEXTM,TEXT1,TEXT2,SPACE,TAB,BEEP,LINE,FORM,LP
  1. Q
  1. ;
  1. SHORT ;no text available may want to just use curser control
  1. I FORM]"" D FORM(FORM,"B")
  1. I LINE]"" D LINE(LINE,"B")
  1. I TAB]"" D TAB(TAB,"B")
  1. I SPACE]"" D SPACE(SPACE,"B")
  1. I BEEP]"",BEEP>0 D BEEP
  1. Q
  1. ;
  1. BODY ;text is available will look at all
  1. I BEEP]"",BEEP>0 D BEEP
  1. I FORM]"" D FORM(FORM,"B")
  1. I LINE]"" D LINE(LINE,"B")
  1. I TAB]"" D TAB(TAB,"B")
  1. I SPACE]"" D SPACE(SPACE,"B")
  1. D TEXT(TEXT2)
  1. I SPACE]"" D SPACE(SPACE,"A")
  1. I TAB]"" D TAB(TAB,"A")
  1. I LINE]"" D LINE(LINE,"A")
  1. I FORM]"" D FORM(FORM,"A")
  1. Q
  1. ;
  1. FORM(A,B) ;issues the form feeds
  1. ;
  1. N VAR,LP
  1. S VAR=$$SET(A,B)
  1. Q:VAR=""
  1. F LP=1:1:VAR W @$S('$D(IOF):"#",IOF="":"#",1:IOF)
  1. Q
  1. ;
  1. LINE(A,B) ;issues the line feeds
  1. ;
  1. N VAR,LP
  1. S VAR=$$SET(A,B)
  1. Q:VAR=""
  1. F LP=1:1:VAR W !
  1. Q
  1. ;
  1. TAB(A,B) ;issues the tabs
  1. ;
  1. N VAR,LP
  1. S VAR=$$SET(A,B)
  1. Q:VAR=""!(VAR=0)
  1. S DX=0,DY=$S(IOST["C-":$S($Y>IOSL:IOSL,1:$Y),1:0)
  1. X ^%ZOSF("XY")
  1. K DX,DY
  1. W ?VAR
  1. Q
  1. ;
  1. SPACE(A,B) ;issues the spaces
  1. ;
  1. N VAR,LP
  1. S VAR=$$SET(A,B)
  1. Q:VAR=""
  1. F LP=1:1:VAR W " "
  1. Q
  1. ;
  1. TEXT(A) ;writes the text
  1. ;
  1. W A
  1. Q
  1. ;
  1. SET(A,B) ;general set statement
  1. ;
  1. Q $S(B="B":+A,1:$P(A,":",2))
  1. ;
  1. BEEP ;does a beep
  1. W *7
  1. Q
  1. ;
  1. SETTEXT ;sets up the two parts of each string
  1. S TEXT1=$P(TEXTM,"^",1)
  1. S TEXT2=$F(TEXTM,"^")
  1. S TEXT2=$E(TEXTM,TEXT2,999)
  1. Q
  1. ;
  1. SETVAR ;sets up the necessary variables for each attribute
  1. S BEEP=$P(TEXT1,",",1)
  1. S SPACE=$P(TEXT1,",",2)
  1. S TAB=$P(TEXT1,",",3)
  1. S LINE=$P(TEXT1,",",4)
  1. S FORM=$P(TEXT1,",",5)
  1. Q
  1. ;
  1. CLEAR ;clears the screen
  1. S VAR(1,0)="0,0,0,3,1^"
  1. D WR^DVBAUTL4("VAR")
  1. K VAR
  1. Q