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

XQT2.m

Go to the documentation of this file.
  1. XQT2 ;SEA/Luke - Define a path template ;06/07/99 11:23
  1. ;;8.0;KERNEL;**37**;Jul 10, 1995
  1. S U="^",XQTSV=XQY_U_XQDIC_U_XQY0
  1. EN ;Entry point for Create a Template Option.
  1. N %,XQTBK1,XQCOM,XQMNTMP,XQI,XQOPN,XQVN,XQSL,XQTF,XQTF1,XQTT,XQTREE,XQTREN
  1. S U="^",(XQI,XQOPN,XQMNTMP,XQVN,XQTREN,XQTF,XQTF1)=0,XQTT="",(XQDIC,XQY)=+^XUTL("XQ",$J,"XQM"),XQY0=^DIC(19,XQDIC,0),XQUR=""
  1. S XQCOM=$O(^DIC(19,"B","XUCOMMAND",0))
  1. S XQLIST(XQOPN)=XQDIC_U_XQY_U_XQY0,XQOPN=XQOPN+1,XQVN=XQVN+1
  1. S XQTREN=1,XQTREE(XQTREN)=XQDIC
  1. S XQAA="Choose one of the "_$P(XQY0,U,2)_" Options: "
  1. ;
  1. I '$D(IOF),'$D(IOSL) D HOME^%ZIS
  1. ;
  1. D SET
  1. ;
  1. INF W @IOF,"Do you want some brief instructions? [Y/N] N// " R XQUR:DTIME S:'$T XQUR=U G:XQUR=U OUT S:XQUR="" XQUR="N" I XQUR["?" W !?3,"Answer 'Y' if you want some instructions, 'N' if you don't." G INF
  1. I "Yy"[XQUR S XQH="XQTCREATE" D EN^XQH
  1. ;
  1. ASK ;Show user the choices and get the next option, if any
  1. W @IOF,?18,"CREATING A MENU TEMPLATE",!!?5,"Choose an option, type RETURN to back up one level,",!?5,"'+' to store the completed template, or '^' to quit.",! D LIST^XQ2
  1. ;
  1. RD1 W !!,?5,XQAA R XQUR:DTIME S:'$T XQUR=U G:XQUR=U OUT G:XQUR="+" STORE
  1. I XQUR["^" W *7,!?3,"Sorry, no jumping." G RD1
  1. I XQUR="?" W !?3,"Enter an option, '+' to store the template,",!?3,"'??' for more help, or '^' to forget the whole thing." G RD1
  1. I XQUR["??" S XQUR="??" S XQTSAV=XQDIC D EN^XQ2 S XQDIC=XQTSAV G RD1
  1. I XQUR="" D BACK S XQDIC=+XQY G ASK
  1. S XQSAVE=XQDIC
  1. D DIC^XQ71
  1. ;
  1. ;
  1. I XQY<0 S XQTSV=XQDIC,XQDIC="U"_DUZ D DIC^XQ71 ;Search secondaries
  1. I XQY<0 S XQDIC=XQCOM D DIC^XQ71 ;Search XUCOMMAND
  1. I XQY<0 S XQDIC=XQTSV W " ??",*7 H 2 G ASK
  1. ;
  1. ;Disallow servers or broker-type options
  1. I XQY>0,"SB"[$P(XQY0,U,4) D
  1. .W " ??",*7
  1. .S XQY=+XQLIST(XQOPN-1),XQY0=$P(XQLIST(XQOPN-1),U,3,99),XQDIC=XQY
  1. .S XQTSB=""
  1. .H 2
  1. .Q
  1. I $D(XQTSB) K XQTSB G ASK
  1. ;
  1. CHK W !!,$P(XQY0,U,2)," ","(",$P(XQY0,U,1),") This one? [Y/N] Y// " R %:DTIME S:%="" %="Y" W:(%["?")!("YyNn"'[%) *7,!!,"Please answer 'Y' or 'N'" G:(%["?")!("yYnN"'[%) CHK G:"Yy"'[% ASK
  1. S XQLIST(XQOPN)=XQY_U_XQDIC_U_XQY0,XQLIST(XQOPN,0)="Entry Action",XQOPN=XQOPN+1,XQVN=XQOPN
  1. S XQTT=XQTT_$S(XQTF:";",1:"")_XQY,XQTF=1
  1. ;
  1. I "MQ"'[$P(XQY0,U,4) D K XQTBK1 G ASK
  1. .S XQTBK1=""
  1. .S XQLIST(XQOPN-1,1)="Exit Action"
  1. .D BACK
  1. .S XQDIC=+XQY
  1. .D SET
  1. .Q
  1. ;
  1. I "MQ"[$P(XQY0,U,4) D G ASK
  1. .S XQDIC=+XQY
  1. .D SET
  1. .S XQAA="Choose one of the "_$P(XQY0,U,2)_" Options: "
  1. .Q
  1. Q
  1. ;
  1. STORE ;Continued in the program ^XQT3
  1. I XQOPN=1 W !!,"A menu template that contains only your log-on menu? Sorry, that's not",!?5,*7,"allowed. Use '^^' to return to your log-on menu instead." G OUT
  1. G ^XQT3
  1. ;
  1. OUT ;Clean up and quit
  1. I $D(XQTSV) S XQY=+XQTSV,XQDIC=$P(XQTSV,U,2),XQY0=$P(XQTSV,U,3,99)
  1. I '$D(XQTSV) S XQY=^(^XUTL("XQ",$J,"T")),XQDIC=$P($P(XQY,U),+XQY,2),XQY0=$P(XQY,U,2,99),XQY=+XQY
  1. K XQTSV
  1. ;
  1. ;Come here on a restart
  1. O1 K D0,DA,DI,DIC,DQ,DR,XQA,XQAA,XQDR,XQH,XQH1,XQH2,XQI,XQJ,XQK,XQOPN,XQLIST,XQLK,XQN,XQNM,XQOO,XQRD,XQRL,XQSAV,XQSN,XQTSV,XQTF,XQTF1,XQTM,XQTRPT,XQTT,XQTXT,XQUR
  1. K XQT,XQT1,XQTSAV,XQSAVE,XQFLAG,XQL,XQLN
  1. Q
  1. ;
  1. BACK ;Back up to last menu-type option and put it on the stack
  1. N %,XQFLG
  1. S XQFLG=0
  1. S:"MQ"[$P(XQY0,U,4) XQFLAG=1
  1. ;
  1. I XQOPN<2!(+XQLIST(0)=+XQLIST(XQOPN-1)) D
  1. .S XQY=+XQLIST(0),XQDIC=$P(XQLIST(0),U,2)
  1. .S XQFLG=1
  1. .W !!,*7,"You can't back up any further!",!!,"Press return to continue...." R %:30
  1. .Q
  1. Q:XQFLG
  1. ;
  1. S XQT1=$P(XQLIST(XQOPN-1),U,2)
  1. F XQJ=0:1:XQOPN-1 Q:XQT1=+XQLIST(XQJ)
  1. ;
  1. I XQJ=(XQOPN-1) D
  1. .S XQT1=+XQLIST(XQOPN-1)
  1. .F XQJ=1:1:$L(XQTT,";") S %=$P(XQTT,";",XQJ) Q:%=XQT1
  1. .S XQJ=XQJ-1
  1. .Q
  1. ;
  1. F XQI=XQJ:-1:0 Q:'XQI Q:"MQ"[$P(XQLIST(XQI),U,6)
  1. I XQI<1 S XQLIST(XQOPN-1,1)="Exit Action",XQLIST(XQOPN)=XQLIST(0),(XQDIC,XQY)=+XQLIST(0),XQY0=$P(XQLIST(0),U,3,99),XQOPN=XQOPN+1,XQAA="Choose one of the "_$P(XQY0,U,2)_" Options: " Q
  1. S XQLIST(XQOPN-1,1)="Exit Action"
  1. S %=XQLIST(XQI),XQY=+%,XQDIC=$P(%,U,2),XQY0=$P(%,U,3,99)
  1. S XQLIST(XQOPN)=XQY_U_XQDIC_U_XQY0,XQOPN=XQOPN+1,XQVN=XQVN-1
  1. ;
  1. ;Drop down one more menu
  1. S XQJ=XQI
  1. F XQI=XQJ:-1:0 Q:'XQI Q:"MQ"[$P(XQLIST(XQI),U,6)
  1. I XQI<1 S XQLIST(XQOPN-1,1)="Exit Action",XQLIST(XQOPN)=XQLIST(0),(XQDIC,XQY)=+XQLIST(0),XQY0=$P(XQLIST(0),U,3,99),XQOPN=XQOPN+1,XQAA="Choose one of the "_$P(XQY0,U,2)_" Options: "
  1. S %=XQLIST(XQI),XQY=+%,XQDIC=$P(%,U,2),XQY0=$P(%,U,3,99)
  1. ;S XQDIC=XQY
  1. I "MQ"[$P(XQY0,U,4) S XQAA="Choose one of the "_$P(XQY0,U,2)_" Options: "
  1. Q
  1. ;
  1. SET ;Rebuild display nodes if neccissary
  1. L +^XUTL("XQO",XQDIC):5 D:$S('$D(^XUTL("XQO",XQDIC,0)):1,'$D(^DIC(19,XQDIC,99)):1,1:^DIC(19,XQDIC,99)'=$P(^XUTL("XQO",XQDIC,0),U,2)) ^XQSET L -^XUTL("XQO",XQDIC)
  1. Q