DDGFADL ;SFISC/MKO-ADJUST DATA LENGTH ;11:28 AM 22 Dec 1993
;;22.0;VA FileMan;;Mar 30, 1999
;Per VHA Directive 10-93-142, this routine should not be modified.
N DDGFE
D DRAW(1)
S DDGFE=0 F S Y=$$READ W:$T(@Y)="" $C(7) D:$T(@Y)]"" @Y Q:DDGFE
Q
;
CHR Q:L'<($P(DDGFLIM,U,4)-D2+1)
S L=L+1,D=D_"_"
D DRAW(1)
Q
CHL Q:L<2
S L=L-1,D=$E(D,1,$L(D)-1)
D DRAW(-1)
Q
DONE ;
S DDGFE=1,D3=D2+L-1,DDGFDY=DY,DDGFDX=DX
S DY=IOSL-6,DX=IOM-9
X IOXY W $J("",7)
S DY=DDGFDY,DX=DDGFDX X IOXY
K DDGFDY,DDGFDX
Q
DRAW(I) ;Draw line
;I = 1 if we've increased the data length, -1 if we've decreased it
;
N S,X,Y
S X=DX,Y=DY
S DY=D1,DX=D2 X IOXY
W $P(DDGLVID,DDGLDEL,6)_D_$P(DDGLVID,DDGLDEL,10)_$E(" ",1,I=-1)
S DY=IOSL-6,DX=IOM-9,S="L="_L X IOXY W S_$J("",7-$L(S))
I I=-1 D REPAINT^DDGLIBW(DDGFWID,D1_U_(D2+L)_U_1_U_1)
;
S DX=X,DY=Y X IOXY
Q
;
READ() N S,Y
F R *Y:DTIME D C Q:Y'=-1
Q Y
;
C I Y<0 S Y="TO" Q
S S=""
C1 S S=S_$C(Y)
I DDGF("DIN")'[(U_S) D I Y=-1 W $C(7) Q
. I $C(Y)'?1L S Y=-1 Q
. S S=$E(S,1,$L(S)-1)_$C(Y-32) S:DDGF("DIN")'[(U_S_U) Y=-1
;
I DDGF("DIN")[(U_S_U),S'=$C(27) S Y=$P(DDGF("DOUT"),U,$L($P(DDGF("DIN"),U_S_U),U)) Q
R *Y:5 G:Y'=-1 C1 W $C(7)
Q
DDGFADL ;SFISC/MKO-ADJUST DATA LENGTH ;11:28 AM 22 Dec 1993
+1 ;;22.0;VA FileMan;;Mar 30, 1999
+2 ;Per VHA Directive 10-93-142, this routine should not be modified.
+3 NEW DDGFE
+4 DO DRAW(1)
+5 SET DDGFE=0
FOR
SET Y=$$READ
IF $TEXT(@Y)=""
WRITE $CHAR(7)
IF $TEXT(@Y)]""
DO @Y
IF DDGFE
QUIT
+6 QUIT
+7 ;
CHR IF L'<($PIECE(DDGFLIM,U,4)-D2+1)
QUIT
+1 SET L=L+1
SET D=D_"_"
+2 DO DRAW(1)
+3 QUIT
CHL IF L<2
QUIT
+1 SET L=L-1
SET D=$EXTRACT(D,1,$LENGTH(D)-1)
+2 DO DRAW(-1)
+3 QUIT
DONE ;
+1 SET DDGFE=1
SET D3=D2+L-1
SET DDGFDY=DY
SET DDGFDX=DX
+2 SET DY=IOSL-6
SET DX=IOM-9
+3 XECUTE IOXY
WRITE $JUSTIFY("",7)
+4 SET DY=DDGFDY
SET DX=DDGFDX
XECUTE IOXY
+5 KILL DDGFDY,DDGFDX
+6 QUIT
DRAW(I) ;Draw line
+1 ;I = 1 if we've increased the data length, -1 if we've decreased it
+2 ;
+3 NEW S,X,Y
+4 SET X=DX
SET Y=DY
+5 SET DY=D1
SET DX=D2
XECUTE IOXY
+6 WRITE $PIECE(DDGLVID,DDGLDEL,6)_D_$PIECE(DDGLVID,DDGLDEL,10)_$EXTRACT(" ",1,I=-1)
+7 SET DY=IOSL-6
SET DX=IOM-9
SET S="L="_L
XECUTE IOXY
WRITE S_$JUSTIFY("",7-$LENGTH(S))
+8 IF I=-1
DO REPAINT^DDGLIBW(DDGFWID,D1_U_(D2+L)_U_1_U_1)
+9 ;
+10 SET DX=X
SET DY=Y
XECUTE IOXY
+11 QUIT
+12 ;
READ() NEW S,Y
+1 FOR
READ *Y:DTIME
DO C
IF Y'=-1
QUIT
+2 QUIT Y
+3 ;
C IF Y<0
SET Y="TO"
QUIT
+1 SET S=""
C1 SET S=S_$CHAR(Y)
+1 IF DDGF("DIN")'[(U_S)
Begin DoDot:1
+2 IF $CHAR(Y)'?1L
SET Y=-1
QUIT
+3 SET S=$EXTRACT(S,1,$LENGTH(S)-1)_$CHAR(Y-32)
IF DDGF("DIN")'[(U_S_U)
SET Y=-1
End DoDot:1
IF Y=-1
WRITE $CHAR(7)
QUIT
+4 ;
+5 IF DDGF("DIN")[(U_S_U)
IF S'=$CHAR(27)
SET Y=$PIECE(DDGF("DOUT"),U,$LENGTH($PIECE(DDGF("DIN"),U_S_U),U))
QUIT
+6 READ *Y:5
IF Y'=-1
GOTO C1
WRITE $CHAR(7)
+7 QUIT