source: IHS-VA_UTILITIES-XB/trunk/XBDHDSP.m@ 1652

Last change on this file since 1652 was 642, checked in by Sam Habiel, 15 years ago

Modified directory structure; moved routines.

File size: 2.7 KB
Line 
1XBDHDSP ; IHS/ADC/GTH - PUTS SPACES BETWEEN HEADERS ; [ 02/07/97 3:02 PM ]
2 ;;4.0;XB;;Jul 20, 2009;Build 2
3 ;
4NEW ;
5 NEW XBDHCHN1,XBDHI,XBDHTH,XBDHREP
6INIT ;
7 S XBDHTH=XBDHCHN-1,XBDHNSL=XBDHTHLW-XBDHCHLW
8 I $P(^TMP("XBDH",$J,"HEADER",1),V,8)>0 G EXIT
9 S $P(^TMP("XBDH",$J,"HEADER",XBDHTH),V,8)=0
10 W !!,"IT IS NOW TIME TO INSERT SPACES BETWEEN HEADER FIELDS",!
11CQ ;
12 S DIR(0)="SO^1:REPATITIVE SPACING;2:MANUAL SPACING;3:AUTOMATIC SPACING",DIR("A")="Your choice",DIR("B")=1,DIR("?")="Automatic spacing puts maximum no. of spaces possible between fields."
13 D ^DIR
14 KILL DIR
15 S XBDHX=Y
16 I XBDHX="" G AUTO
17 I XBDHX=1 G REP
18MANUAL ;
19 S XBDHCHN1=""
20 F XBDHL=0:0 S XBDHCHN1=$O(^TMP("XBDH",$J,"HEADER",XBDHCHN1)) G:XBDHCHN1=XBDHTH!(XBDHCHN1="") EXIT D MAN
21EXIT ;
22 S DIR("B")="NO",DIR(0)="YO",DIR("A")="Want to make any more spacing changes"
23 D ^DIR
24 KILL DIR
25 I Y=1 W !! G CQ
26 I Y=U S XBDHQUIT="" Q
27 Q
28 ;
29MAN ;
30 S XBDHY=$C(64+XBDHCHN1),XBDHZ=^TMP("XBDH",$J,"HEADER",XBDHCHN1)
31 W !!,"PUT SPACES AFTER HEADER """,$C(64+XBDHCHN1),""""
32 W !,"TOTAL NUMBER OF UNUSED COLUMNS LEFT: ",XBDHNSL
33 W !,"TOTAL NUMBER OF HEADERS LEFT: ",XBDHTH+1-XBDHCHN1,!
34SP ;
35 S DIR(0)="NO^::",DIR("A")="How many spaces do you want after field "_$C(64+XBDHCHN1)
36 S:$G(DIR("B"))]"" DIR("B")=XBDHX
37 D ^DIR
38 KILL DIR
39 S XBDHX=Y
40 I XBDHX="" S XBDHCHN1=XBDHTH-1 Q
41 I XBDHX?1"^"1U,$E(XBDHX,2)']$C(64+XBDHTH),($A(XBDHX)-64)'=XBDHTH S XBDHCHN1=$A($E(XBDHX,2))-64 G MAN
42 I XBDHX'=+XBDHX W *7,*7,*13,$J("",IOM),*13 G SP
43 I (XBDHX-$P(^TMP("XBDH",$J,"HEADER",XBDHCHN1),V,8))>XBDHNSL W *7,*7,*13,$J("",IOM),*13 G SP
44 S XBDHY=$P(^TMP("XBDH",$J,"HEADER",XBDHCHN1),V,8),$P(^TMP("XBDH",$J,"HEADER",XBDHCHN1),V,8)=XBDHX,XBDHNSL=XBDHNSL-XBDHX+XBDHY
45 D ^XBDHD1
46 Q
47 ;
48AUTO ;
49 S XBDHNSL=(XBDHTHLW-XBDHCHLW),XBDHY=XBDHNSL\(XBDHTH-1),XBDHZ=XBDHNSL-(XBDHY*(XBDHTH-1)),XBDHCHN1=""
50 F XBDHI=1:1 S XBDHCHN1=$O(^TMP("XBDH",$J,"HEADER",XBDHCHN1)) Q:XBDHCHN1=XBDHTH!(XBDHCHN1="") S XBDHX=XBDHY S:XBDHI'>XBDHZ XBDHX=XBDHX+1 S $P(^TMP("XBDH",$J,"HEADER",XBDHCHN1),V,8)=XBDHX
51 S XBDHNSL=0
52 D ^XBDHD1
53 G EXIT
54 ;
55REP ;
56 W !
57 S XBDHNSL=(XBDHTHLW-XBDHCHLW),XBDHREP=XBDHNSL\(XBDHTH-1),XBDHCHN1=""
58EREP ;
59 S DIR(0)="NO^0:"_XBDHREP_":",DIR("A")="How many spaces between each header field",DIR("B")=XBDHREP
60 D ^DIR
61 KILL DIR
62 S XBDHX=Y
63 I XBDHX'=+XBDHX W *7,*7,*13,$J("",IOM),*13 G EREP
64 I XBDHX>XBDHREP W *7,*7,*13,$J("",IOM),*13 G EREP
65 I XBDHX="" S XBDHX=0
66 F XBDHI=1:1 S XBDHCHN1=$O(^TMP("XBDH",$J,"HEADER",XBDHCHN1)) Q:XBDHCHN1=XBDHTH!(XBDHCHN1="") S:XBDHCHN1'["." $P(^TMP("XBDH",$J,"HEADER",XBDHCHN1),V,8)=XBDHX,XBDHNSL=XBDHNSL-XBDHX
67 D ^XBDHD1
68 G EXIT
69 ;
70NOTES ;
71 ; PUTS SPACES BETWEEN FIELDS ON THE HEADER LINE
72 ; INPUT = XBDHCHLW,XBDHTHLW,XBDHCHN
73 ; OUTPUT = 8TH PIECE OF ^TMP("XBDH",$J,"HEADER",XBDHCHN)
74 ; IGNORES PURE MUMPS EXPRESSION AS DESIGNATED BY DECIMAL XBDHCHN
Note: See TracBrowser for help on using the repository browser.