Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XBHFMAN

XBHFMAN.m

Go to the documentation of this file.
  1. XBHFMAN ; IHS/ADC/GTH - HELP FRAME MANUAL (1/2) ; [ 02/07/97 3:02 PM ]
  1. ;;3.0;IHS/VA UTILITIES;;FEB 07, 1997
  1. ;
  1. ; Print a help frame manual for an IHS application, using
  1. ; OPTION descriptions and HELP FRAME texts in the namespace
  1. ; of the application selected from the PACKAGE file.
  1. ;
  1. ; Information for the title and preface pages, and for
  1. ; indexed words, is expected to be in a routine named
  1. ; <namespace>HFMN. The title page lines are expected to
  1. ; begin at line TITLE+1, and the preface page at PREFACE+1.
  1. ; Any words to be indexed are expected to begin at line
  1. ; INDEX+1. See routine XBHFMAN2 for an example.
  1. ;
  1. ; If entered from the top, user is asked for application.
  1. ; Entry point EN() must have the namespace of the application
  1. ; as the parameter. That allows programmers to create their
  1. ; own option and call it, without forcing user to select the
  1. ; applcation.
  1. ;
  1. D HOME^%ZIS,DT^DICRW
  1. NEW DIR,XBSEL
  1. G EN1
  1. ;
  1. EN(XBSEL) ;PEP ----- From application options, with namespace of application.
  1. ;
  1. EN1 ;
  1. S DIC=9.4,DIC(0)="AEM",DIC("S")="I ""AB""[$E($P(^(0),U,2))"
  1. I $D(XBSEL) S X=XBSEL,DIC(0)="",D="C" D IX^DIC I 1
  1. E D ^DIC
  1. I Y<1 W !,"^DIC( LOOKUP FAILED." Q
  1. S XBSEL=+Y
  1. DEV ;
  1. S %ZIS="OPQ"
  1. D ^%ZIS
  1. I POP S IOP=$I D ^%ZIS G K
  1. G:'$D(IO("Q")) START
  1. KILL IO("Q")
  1. I $D(IO("S"))!($E(IOST)'="P") W *7,!,"Please queue to system printers." D ^%ZISC G DEV
  1. S ZTRTN="START^XBHFMAN",ZTDESC="Help Frame Manual for "_$P(^DIC(9.4,XBSEL,0),U),ZTIO=ION_";"_IOST_";"_IOM_";"_IOSL,ZTSAVE("XBSEL")=""
  1. D ^%ZTLOAD
  1. G:'$D(ZTSK) DEV
  1. K ;
  1. KILL XB,ZTSK
  1. D ^%ZISC
  1. D END^XBHFMAN1
  1. Q
  1. ;
  1. START ;EP ----- From TaskMan.
  1. ;
  1. I '$D(ZTQUEUED),'$D(IO("S")) U IO(0) D WAIT^DICD U IO
  1. ;
  1. NEW DIWL,DIWR,DIWF,DIRUT
  1. NEW XBBM,XBCHAP,XBCONT,XBSAVX,XBTM,XBTITL,XBPG,XBHDR,XBHDRE,XBHDRO,XBDASH,XBSTRIP,XBNOHDR,XBIENI,XBLEVEL,XBNAME,XBNS
  1. ;
  1. KILL ^TMP("XBHFMAN",$J),^UTILITY($J)
  1. ;
  1. ; S X=$O(^DIC(9.4,XBSEL,22,"B","0.5",0))
  1. ; 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)=""
  1. ;
  1. ; ----- Set namespace and read indexed words into ^TMP("XBHFMAN-I",$J.
  1. S XBNS=$P(^DIC(9.4,XBSEL,0),U,2)
  1. F X=1:1 S Y=$P($T(@"INDX"+X^@(XBNS_"HFMN")),";",3) Q:'$L(Y) S ^TMP("XBHFMAN-I",$J,Y)=""
  1. ;
  1. S DIWL=10,DIWR=74,DIWF="W"
  1. 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)
  1. S XBSTRIP=^DD("FUNC",$O(^DD("FUNC","B","STRIPBLANKS",0)),1)
  1. S (XBCHAP,XBLEVEL)=1,(XBCONT,XBHDR,XBPG,XBNOHDR)=0
  1. ;
  1. ; ----- Set primary menu as chapter 1.
  1. D SETTMP($O(^DIC(19,"B",XBNS_"MENU",0)),"1")
  1. ;
  1. S XBNAME=XBNS
  1. 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)=""
  1. KILL ^TMP("XBHFMAN-M",$J,XBNS_"MENU")
  1. D MENU($O(^DIC(19,"B",XBNS_"MENU",0)))
  1. ;
  1. S XBCHAP=1,XBNAME=""
  1. 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)))
  1. ;
  1. U IO
  1. D ^XBHFMAN1
  1. Q
  1. ;
  1. ;
  1. Q:'$G(I)
  1. NEW X
  1. S X=0,XBLEVEL=XBLEVEL+1
  1. 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
  1. Q
  1. ;
  1. DATA(I,N,P) ;
  1. Q $P(^DIC(19,I,N),U,P)
  1. ;
  1. ;
  1. ;
  1. RTRN ;EP ----- If interactive, ask usr to press RETURN.
  1. I IOST["C-",'$D(IO("S")),$$DIR^XBDIR("E","Press RETURN To Continue or ""^"" to exit","","","","",1)
  1. Q
  1. ;
  1. SETTMP(I,N) ; ----- Set option IEN and chapter designation into ^TMP.
  1. NEW X,Y
  1. I '$D(ZTQUEUED),'$D(IO("S")) U IO(0) W "." U IO
  1. F %=1:1 I '$P(N,".",%) S N=$P(N,".",1,%-1) Q
  1. S ^(0)=$G(^TMP("XBHFMAN",$J,0))+1
  1. S ^TMP("XBHFMAN",$J,^TMP("XBHFMAN",$J,0))=I_"^"_N
  1. Q
  1. ;