source: IHS-VA_UTILITIES-XB/trunk/XBTM.m@ 1088

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

Modified directory structure; moved routines.

File size: 4.1 KB
Line 
1XBTM ; IHS/ADC/GTH - TECH MANUAL : MAIN ; [ 02/07/97 3:02 PM ]
2 ;;4.0;XB;;Jul 20, 2009;Build 2
3 ;
4 ; This routine, and subsequent routines in the XBTM*
5 ; namespace, produce a technical manual from information
6 ; contained in the package. The manual is approximately 80
7 ; pages. All, or individual chapters can be printed.
8 ;
9 D HOME^%ZIS,DT^DICRW
10 NEW DIR,XBSEL
11SEL ;
12 S XBSEL=$$DIR^XBDIR("S^1:only one chapter;A:All chapters","Print 1 chapter, or all? 1/A","1")
13 S:$D(DUOUT) DIRUT=1
14 Q:$D(DIRUT)
15 I XBSEL S XBSEL=$$DIR^XBDIR("N^1:15:0","Which chapter?","","","","^D CHAPS^XBTM") S:$D(DUOUT) DIRUT=1
16 Q:$D(DIRUT)
17DEV ;
18 S %ZIS="OPQ"
19 D ^%ZIS
20 I POP S IOP=$I D ^%ZIS G K
21 G:'$D(IO("Q")) START
22 KILL IO("Q")
23 I $D(IO("S"))!($E(IOST)'="P") W *7,!,"Please queue to system printers." D ^%ZISC G DEV
24 S ZTRTN="START^XBTM",ZTDESC="TECHNICAL MANUAL.",ZTIO=ION_";"_IOST_";"_IOM_";"_IOSL,ZTSAVE("XBSEL")=""
25 D ^%ZTLOAD
26 G:'$D(ZTSK) DEV
27K ;
28 KILL XB,ZTSK
29 D ^%ZISC
30 G END
31 ;
32START ;EP - TaskMan.
33 NEW DIWL,DIWR,DIWF,XBBM,XBCONT,XBSAVX,XBTM,XBTITL,XBPG,XBHDR,XBHDRE,XBHDRO,XBDASH
34 D ^XBKTMP
35 S DIWL=10,DIWR=74,DIWF="W",XBBM=IOSL-5,XBTM=6,XBTITL="IHS/VA UTILITIES TECHNICAL MANUAL",XBPG=0,XBHDR="Index",(XBHDRE,XBHDRO)="",XBDASH="",$P(XBDASH,"-",81)="",XBDASH=$E(XBDASH,DIWL,DIWR)
36 U IO
37 I 'XBSEL D ^XBTMI S DIWF="WN" D ^XBTMTI W @IOF S DIWF="W" D ^XBTMPR W @IOF
38BODY ;
39 S (XBCONT,XBHDR,XBPG)=0
40 KILL ^TMP("XBTM-CONTENTS",$J)
41 I XBSEL S XBCHAP=XBSEL D MAKEHDRS,TOF Q:$D(DUOUT) D HDR(XBCHAP),@("^XBTM"_XBCHAP) G END
42 F XBCHAP=1:1:15 D MAKEHDRS,TOF Q:$D(DUOUT) D HDR(XBCHAP),@("^XBTM"_XBCHAP)
43 ;
44INDEX ;
45 S XBHDR="Index"
46 D TOF
47 G:$D(DUOUT) HAT
48 W !!!
49 S X="|NOWRAP||SETTAB(""C"")||TAB|INDEX"
50 D ^DIWP,^DIWW
51 W !!!
52 D CONT("INDEX^^"_XBPG)
53 S (XB,XBCONT)="",$P(XBCONT,".",81)=""
54 F S XB=$O(^TMP("XBTM-INDEX",$J,XB)) Q:XB="" Q:$D(DUOUT) S X="" D
55 .F XBX=0:0 S XBX=$O(^TMP("XBTM-INDEX",$J,XB,XBX)) Q:$D(DUOUT) S X=X_XBX_"," I '$O(^(XBX)) D Q
56 ..S X=XB_$E(XBCONT,1,DIWR-DIWL-$L(XB)-$L(X))_$E(X,1,$L(X)-1)
57 ..S XBSAVX=X
58 ..F S X=$E(XBSAVX,1,DIWR-DIWL),XBSAVX=$E(XBSAVX,DIWR-DIWL+1,$L(XBSAVX)) Q:'$L(X) D TOF:$Y>XBBM Q:$D(DUOUT) D ^DIWP
59 ..Q
60 .Q
61 D ^DIWW,PAUSE^XB
62 G:$D(DUOUT) HAT
63 ;
64CONTENTS ;
65 W @IOF,!!!!!
66 S X="|SETTAB(""C"")||TAB|CONTENTS"
67 D ^DIWP,^DIWW
68 W !!
69 S XB=0
70 F S XB=$O(^TMP("XBTM-CONTENTS",$J,XB)) Q:'+XB S X=^(XB),X=$P(X,U)_" "_$P(X,U,2)_$E(XBCONT,1,DIWR-DIWL-$L(X)+1)_$P(X,U,3) D TOF:$Y>XBBM Q:$D(DUOUT) D ^DIWP
71 G:$D(DUOUT) HAT
72 D ^DIWW,PAUSE^XB
73 G:$D(DUOUT) HAT
74END ;
75 D PAUSE^XB
76 G:$D(DUOUT) HAT
77 W @IOF
78HAT ;
79 D ^%ZISC
80 KILL XB,XBBM,XBCHAP,XBCONT,XBODD,XBHDR,XBIEN,XBPARA,XBPG,XBROOT,XBTITL,XBTM,XBX,XBY,DIC,DIWF,DIWL,DIWR
81 D ^XBKTMP
82 Q
83 ;
84TEXT(XBLAB) ;
85 F XB=1:1 S X=$P($T(@XBLAB+XB),";;",2) Q:X="###" D PR(X) Q:$D(DUOUT)
86 Q:$D(DUOUT)
87 D ^DIWW
88 Q
89 ;
90PR(X) ;EP
91 I X="|TOP|" D TOF Q
92 D INDX(X),^DIWP,TOF:$Y>XBBM
93 Q
94 ;
95INDX(X) ;
96 Q:'$D(XBPG)
97 S X=$TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
98 S %=""
99 F S %=$O(^TMP("XBTM-I",$J,%)) Q:'$L(%) I $F(X,%) S ^TMP("XBTM-INDEX",$J,%,XBPG)=""
100 Q
101 ;
102HDR(XB) ;
103 F X="|SETTAB(""C"")||TAB|Chapter "_XB,"|SETTAB(""C"")||TAB|"_$P($T(@XB),";",3) D ^DIWP
104 W !!
105 D CONT(XB_U_$P($T(@XB),";",3)_U_XBPG)
106 Q
107 ;
108TOF ;EP
109 F Q:$Y>XBBM W !
110 I XBPG>0 W !?(DIWL-1),XBDASH,!,?$S(XBODD:DIWR-$L(XBTITL),1:DIWL-1),XBTITL
111 D PAUSE^XB
112 Q:$D(DUOUT)
113 W @IOF
114 S XBPG=XBPG+1,XBODD=XBPG#2
115 F Q:$Y=(XBTM-2) W !
116 W ?$S(XBODD:DIWR-$L("Page "_XBPG),1:DIWL-1),"Page ",XBPG
117 I '(XBHDR="Index") W !?DIWL-1,$S(XBODD:XBHDRO,1:XBHDRE)
118 W !?(DIWL-1),XBDASH,!!
119 Q
120 ;
121MAKEHDRS ;
122 S (XBHDRE,XBHDRO)=$P($T(@XBCHAP),";",3)
123 S XBHDRO=XBHDRO_$J("",DIWR-DIWL-$L(XBHDRO)-$L("Chapter "_XBCHAP)+1)_"Chapter "_XBCHAP
124 S XBHDRE="Chapter "_XBCHAP_$J("",DIWR-DIWL-$L(XBHDRE)-$L("Chapter "_XBCHAP)+1)_XBHDRE
125 Q
126 ;
127CONT(X) ;
128 S XBCONT=XBCONT+1,^TMP("XBTM-CONTENTS",$J,XBCONT)=X
129 Q
130 ;
131CHAPS ;EP - From DIR
132 F %=1:1:15 W !?3,$J(%,2),". ",$P($T(@%),";",3)
133 Q
1341 ;;Facility Parameters
1352 ;;Area Office Parameters
1363 ;;Security Keys
1374 ;;Options
1385 ;;Fields in Files
1396 ;;Archiving and Purging
1407 ;;Callable Routines
1418 ;;External Relations
1429 ;;Internal Relations
14310 ;;How to Generate On-Line Documentation
14411 ;;Glossary
14512 ;;System Requirements
14613 ;;Installation notes
14714 ;;Enhancements
14815 ;;KILL of Unsubscripted Globals
Note: See TracBrowser for help on using the repository browser.