DDSBOX(DDSUL,DDSLR) ;SFISC/MKO-DRAW A BOX ;08:17 AM 9 Apr 1993
;;22.0;VA FileMan;;Mar 30, 1999
;Per VHA Directive 10-93-142, this routine should not be modified.
D BOUNDS Q:'Y
;
S DDS3L=""
S $P(DDS3L,$P(DDGLGRA,DDGLDEL,3),$P(DDSLR,",",2)-$P(DDSUL,",",2))=""
S DDS3M=$P(DDGLGRA,DDGLDEL,4)_$J("",$P(DDSLR,",",2)-$P(DDSUL,",",2)-1)_$P(DDGLGRA,DDGLDEL,4)
;
S DY=$P(DDSUL,",")-1,DX=$P(DDSUL,",",2)-1 X IOXY
W $P(DDGLGRA,DDGLDEL)_$P(DDGLGRA,DDGLDEL,5)_DDS3L_$P(DDGLGRA,DDGLDEL,6)
;
F DY=$P(DDSUL,","):1:$P(DDSLR,",")-2 D
. S DX=$P(DDSUL,",",2)-1 X IOXY
. W DDS3M
;
S DY=$P(DDSLR,",")-1,DX=$P(DDSUL,",",2)-1 X IOXY
W $P(DDGLGRA,DDGLDEL,7)_DDS3L_$P(DDGLGRA,DDGLDEL,8)_$P(DDGLGRA,DDGLDEL,2)
;
K DDS3L,DDS3M
Q
;
CLEAR(DDSUL,DDSLR) ;Clear area within upper left and lower right coords
N S
D BOUNDS Q:'Y
;
S S=$J("",$P(DDSLR,",",2)-$P(DDSUL,",",2)+1)
S DX=$P(DDSUL,",",2)-1
F DY=$P(DDSUL,",")-1:1:$P(DDSLR,",")-1 X IOXY W S
Q
;
BOUNDS ;Make sure area is within acceptable boundaries
N DDSV,DDSP
S Y=1
I $G(DDSUL)=""!($G(DDSLR))="" S Y=0 Q
;
F DDSV="DDSUL","DDSLR" D
. S:$P(@DDSV,",")>DDSHBX $P(@DDSV,",")=DDSHBX
. S:$P(@DDSV,",",2)>(IOM-1) $P(@DDSV,",",2)=IOM-1
. F DDSP=1,2 S:$P(@DDSV,",",DDSP)<1 $P(@DDSV,",",DDSP)=1
;
I $P(DDSLR,",")-$P(DDSUL,",")<2 S Y=0 Q
I $P(DDSLR,",",2)-$P(DDSUL,",",2)<2 S Y=0 Q
;
Q
DDSBOX(DDSUL,DDSLR) ;SFISC/MKO-DRAW A BOX ;08:17 AM 9 Apr 1993
+1 ;;22.0;VA FileMan;;Mar 30, 1999
+2 ;Per VHA Directive 10-93-142, this routine should not be modified.
+3 DO BOUNDS
IF 'Y
QUIT
+4 ;
+5 SET DDS3L=""
+6 SET $PIECE(DDS3L,$PIECE(DDGLGRA,DDGLDEL,3),$PIECE(DDSLR,",",2)-$PIECE(DDSUL,",",2))=""
+7 SET DDS3M=$PIECE(DDGLGRA,DDGLDEL,4)_$JUSTIFY("",$PIECE(DDSLR,",",2)-$PIECE(DDSUL,",",2)-1)_$PIECE(DDGLGRA,DDGLDEL,4)
+8 ;
+9 SET DY=$PIECE(DDSUL,",")-1
SET DX=$PIECE(DDSUL,",",2)-1
XECUTE IOXY
+10 WRITE $PIECE(DDGLGRA,DDGLDEL)_$PIECE(DDGLGRA,DDGLDEL,5)_DDS3L_$PIECE(DDGLGRA,DDGLDEL,6)
+11 ;
+12 FOR DY=$PIECE(DDSUL,","):1:$PIECE(DDSLR,",")-2
Begin DoDot:1
+13 SET DX=$PIECE(DDSUL,",",2)-1
XECUTE IOXY
+14 WRITE DDS3M
End DoDot:1
+15 ;
+16 SET DY=$PIECE(DDSLR,",")-1
SET DX=$PIECE(DDSUL,",",2)-1
XECUTE IOXY
+17 WRITE $PIECE(DDGLGRA,DDGLDEL,7)_DDS3L_$PIECE(DDGLGRA,DDGLDEL,8)_$PIECE(DDGLGRA,DDGLDEL,2)
+18 ;
+19 KILL DDS3L,DDS3M
+20 QUIT
+21 ;
CLEAR(DDSUL,DDSLR) ;Clear area within upper left and lower right coords
+1 NEW S
+2 DO BOUNDS
IF 'Y
QUIT
+3 ;
+4 SET S=$JUSTIFY("",$PIECE(DDSLR,",",2)-$PIECE(DDSUL,",",2)+1)
+5 SET DX=$PIECE(DDSUL,",",2)-1
+6 FOR DY=$PIECE(DDSUL,",")-1:1:$PIECE(DDSLR,",")-1
XECUTE IOXY
WRITE S
+7 QUIT
+8 ;
BOUNDS ;Make sure area is within acceptable boundaries
+1 NEW DDSV,DDSP
+2 SET Y=1
+3 IF $GET(DDSUL)=""!($GET(DDSLR))=""
SET Y=0
QUIT
+4 ;
+5 FOR DDSV="DDSUL","DDSLR"
Begin DoDot:1
+6 IF $PIECE(@DDSV,",")>DDSHBX
SET $PIECE(@DDSV,",")=DDSHBX
+7 IF $PIECE(@DDSV,",",2)>(IOM-1)
SET $PIECE(@DDSV,",",2)=IOM-1
+8 FOR DDSP=1,2
IF $PIECE(@DDSV,",",DDSP)<1
SET $PIECE(@DDSV,",",DDSP)=1
End DoDot:1
+9 ;
+10 IF $PIECE(DDSLR,",")-$PIECE(DDSUL,",")<2
SET Y=0
QUIT
+11 IF $PIECE(DDSLR,",",2)-$PIECE(DDSUL,",",2)<2
SET Y=0
QUIT
+12 ;
+13 QUIT