source: IHS-VA_UTILITIES-XB/trunk/XBHFMAN.m@ 1330

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

Modified directory structure; moved routines.

File size: 3.8 KB
Line 
1XBHFMAN ; IHS/ADC/GTH - HELP FRAME MANUAL (1/2) ; [ 02/07/97 3:02 PM ]
2 ;;4.0;XB;;Jul 20, 2009;Build 2
3 ;
4 ; Print a help frame manual for an IHS application, using
5 ; OPTION descriptions and HELP FRAME texts in the namespace
6 ; of the application selected from the PACKAGE file.
7 ;
8 ; Information for the title and preface pages, and for
9 ; indexed words, is expected to be in a routine named
10 ; <namespace>HFMN. The title page lines are expected to
11 ; begin at line TITLE+1, and the preface page at PREFACE+1.
12 ; Any words to be indexed are expected to begin at line
13 ; INDEX+1. See routine XBHFMAN2 for an example.
14 ;
15 ; If entered from the top, user is asked for application.
16 ; Entry point EN() must have the namespace of the application
17 ; as the parameter. That allows programmers to create their
18 ; own option and call it, without forcing user to select the
19 ; applcation.
20 ;
21 D HOME^%ZIS,DT^DICRW
22 NEW DIR,XBSEL
23 G EN1
24 ;
25EN(XBSEL) ;PEP ----- From application options, with namespace of application.
26 ;
27EN1 ;
28 S DIC=9.4,DIC(0)="AEM",DIC("S")="I ""AB""[$E($P(^(0),U,2))"
29 I $D(XBSEL) S X=XBSEL,DIC(0)="",D="C" D IX^DIC I 1
30 E D ^DIC
31 I Y<1 W !,"^DIC( LOOKUP FAILED." Q
32 S XBSEL=+Y
33DEV ;
34 S %ZIS="OPQ"
35 D ^%ZIS
36 I POP S IOP=$I D ^%ZIS G K
37 G:'$D(IO("Q")) START
38 KILL IO("Q")
39 I $D(IO("S"))!($E(IOST)'="P") W *7,!,"Please queue to system printers." D ^%ZISC G DEV
40 S ZTRTN="START^XBHFMAN",ZTDESC="Help Frame Manual for "_$P(^DIC(9.4,XBSEL,0),U),ZTIO=ION_";"_IOST_";"_IOM_";"_IOSL,ZTSAVE("XBSEL")=""
41 D ^%ZTLOAD
42 G:'$D(ZTSK) DEV
43K ;
44 KILL XB,ZTSK
45 D ^%ZISC
46 D END^XBHFMAN1
47 Q
48 ;
49START ;EP ----- From TaskMan.
50 ;
51 I '$D(ZTQUEUED),'$D(IO("S")) U IO(0) D WAIT^DICD U IO
52 ;
53 NEW DIWL,DIWR,DIWF,DIRUT
54 NEW XBBM,XBCHAP,XBCONT,XBSAVX,XBTM,XBTITL,XBPG,XBHDR,XBHDRE,XBHDRO,XBDASH,XBSTRIP,XBNOHDR,XBIENI,XBLEVEL,XBNAME,XBNS
55 ;
56 KILL ^TMP("XBHFMAN",$J),^UTILITY($J)
57 ;
58 ; S X=$O(^DIC(9.4,XBSEL,22,"B","0.5",0))
59 ; I X S %=0 F S %=$O(^DIC(9.4,XBSEL,22,X,"P",%)) Q:'% S Y=^(%,0) I $L(Y) S ^TMP("XBHFMAN-I",$J,Y)=""
60 ;
61 ; ----- Set namespace and read indexed words into ^TMP("XBHFMAN-I",$J.
62 S XBNS=$P(^DIC(9.4,XBSEL,0),U,2)
63 F X=1:1 S Y=$P($T(@"INDX"+X^@(XBNS_"HFMN")),";",3) Q:'$L(Y) S ^TMP("XBHFMAN-I",$J,Y)=""
64 ;
65 S DIWL=10,DIWR=74,DIWF="W"
66 S XBBM=IOSL-5,XBTM=6,XBTITL=$P(^DIC(9.4,XBSEL,0),U)_" HELP FRAME MANUAL",XBPG=0,XBHDR="Index",(XBHDRE,XBHDRO)="",XBDASH="",$P(XBDASH,"-",81)="",XBDASH=$E(XBDASH,DIWL,DIWR)
67 S XBSTRIP=^DD("FUNC",$O(^DD("FUNC","B","STRIPBLANKS",0)),1)
68 S (XBCHAP,XBLEVEL)=1,(XBCONT,XBHDR,XBPG,XBNOHDR)=0
69 ;
70 ; ----- Set primary menu as chapter 1.
71 D SETTMP($O(^DIC(19,"B",XBNS_"MENU",0)),"1")
72 ;
73 S XBNAME=XBNS
74 F S XBNAME=$O(^DIC(19,"B",XBNAME)) Q:$E(XBNAME,1,$L(XBNS))'=XBNS I '$D(^DIC(19,"AD",$O(^DIC(19,"B",XBNAME,0)))) S ^TMP("XBHFMAN-M",$J,XBNAME)=""
75 KILL ^TMP("XBHFMAN-M",$J,XBNS_"MENU")
76 D MENU($O(^DIC(19,"B",XBNS_"MENU",0)))
77 ;
78 S XBCHAP=1,XBNAME=""
79 F S XBNAME=$O(^TMP("XBHFMAN-M",$J,XBNAME)) Q:XBNAME="" S XBCHAP=+$P(XBCHAP,".")+1,XBLEVEL=1 D SETTMP($O(^DIC(19,"B",XBNAME,0)),XBCHAP),MENU($O(^DIC(19,"B",XBNAME,0)))
80 ;
81 U IO
82 D ^XBHFMAN1
83 Q
84 ;
85 ;
86MENU(I) ; ----- Assign chapter number to OPTIONs. Recurse if OPTION is a menu.
87 Q:'$G(I)
88 NEW X
89 S X=0,XBLEVEL=XBLEVEL+1
90 F S X=$O(^DIC(19,I,10,X)) Q:'X S $P(XBCHAP,".",XBLEVEL)=$P(XBCHAP,".",XBLEVEL)+1,Y=+^(X,0) D SETTMP(Y,XBCHAP) I $$DATA(Y,0,4)="M" D MENU(Y) S $P(XBCHAP,".",XBLEVEL)=0,XBLEVEL=XBLEVEL-1
91 Q
92 ;
93DATA(I,N,P) ;
94 Q $P(^DIC(19,I,N),U,P)
95 ;
96 ;
97 ;
98RTRN ;EP ----- If interactive, ask usr to press RETURN.
99 I IOST["C-",'$D(IO("S")),$$DIR^XBDIR("E","Press RETURN To Continue or ""^"" to exit","","","","",1)
100 Q
101 ;
102SETTMP(I,N) ; ----- Set option IEN and chapter designation into ^TMP.
103 NEW X,Y
104 I '$D(ZTQUEUED),'$D(IO("S")) U IO(0) W "." U IO
105 F %=1:1 I '$P(N,".",%) S N=$P(N,".",1,%-1) Q
106 S ^(0)=$G(^TMP("XBHFMAN",$J,0))+1
107 S ^TMP("XBHFMAN",$J,^TMP("XBHFMAN",$J,0))=I_"^"_N
108 Q
109 ;
Note: See TracBrowser for help on using the repository browser.