source: WorldVistAEHR/trunk/r/VA_FILEMAN-ARJT-DI-DD-DM-DT-%DT-%RCR/DDGFUPDB.m@ 1154

Last change on this file since 1154 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.6 KB
RevLine 
[613]1DDGFUPDB ;SFISC/MKO-UPDATE BLOCK COORDINATES ;03:28 PM 17 Aug 1993
2 ;;22.0;VA FileMan;;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4BLK(DDGFORIG) ;
5 ;Update image with adjusted block coordinates
6 ; DDGFORIG(B) : defined for all blocks that changed coordinates
7 ; = original $Y^original $X
8 N P,P1,P2,B,B1,B2,F,C1,C2,C3,C,D1,D2,D3,L,X1,Y1,N,I
9 ;
10 ;Get page coordinates
11 S P=DDGFPG
12 S P1=$P(@DDGFREF@("F",P),U),P2=$P(@DDGFREF@("F",P),U,2)
13 ;
14 ;Loop through all blocks on page
15 S B="" F S B=$O(@DDGFREF@("F",P,B)) Q:B="" D BK
16 Q
17 ;
18BK ;Get block coordinates
19 S B2=@DDGFREF@("F",P,B)
20 S B1=$P(B2,U),B2=$P(B2,U,2)
21 ;
22 ;Get Y1=delta $Y, X1=delta $X
23 I $D(DDGFORIG(B)) S Y1=B1-$P(DDGFORIG(B),U),X1=B2-$P(DDGFORIG(B),U,2)
24 E S (Y1,X1)=0
25 I 'Y1,'X1 K DDGFORIG(B)
26 ;
27 ;Loop through all fields on block
28 S F="" F S F=$O(@DDGFREF@("F",P,B,F)) Q:F="" D FD
29 Q
30 ;
31FD ;
32 ;Get field data
33 S N=@DDGFREF@("F",P,B,F)
34 S C1=$P(N,U),C2=$P(N,U,2),C3=$P(N,U,3),C=$P(N,U,4)
35 S D1=$P(N,U,5),D2=$P(N,U,6),D3=$P(N,U,7),L=$P(N,U,8)
36 ;
37 I $D(DDGFORIG(B)) D
38 . I Y1 S:C1]"" $P(N,U)=C1+Y1 S:L $P(N,U,5)=D1+Y1
39 . I X1 D
40 .. I C]"" F I=2,3 S $P(N,U,I)=$P(N,U,I)+X1
41 .. I L F I=6,7 S $P(N,U,I)=$P(N,U,I)+X1
42 . S @DDGFREF@("F",P,B,F)=N
43 . ;
44 . I C]"" D
45 .. K @DDGFREF@("RC",DDGFWID,C1,C2,C3,B,F,"C")
46 .. S @DDGFREF@("RC",DDGFWID,$P(N,U),$P(N,U,2),$P(N,U,3),B,F,"C")=""
47 . I L D
48 .. K @DDGFREF@("RC",DDGFWID,D1,D2,D3,B,F,"D")
49 .. S @DDGFREF@("RC",DDGFWID,$P(N,U,5),$P(N,U,6),$P(N,U,7),B,F,"D")=""
50 ;
51 I C]"" D WRITE^DDGLIBW(DDGFWID,C,$P(N,U)-P1,$P(N,U,2)-P2)
52 I L D WRITE^DDGLIBW(DDGFWID,$TR($J("",L)," ","_"),$P(N,U,5)-P1,$P(N,U,6)-P2)
53 Q
Note: See TracBrowser for help on using the repository browser.