XQ62 ;SEA/MJM - Generalized file look-up utility ;8/2/89 09:53;5/13/93 11:53 AM [ 04/02/2003 8:29 AM ]
;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
;;8.0;KERNEL;;Jul 10, 1995
S U="^" K ^TMP($J)
W !!,?10,"3. The User File",!!,?10,"4. A mail group"
;
ASK ;Get user's response, check it, and branch to subroutine
R !!,?5,"Enter a number or '^' to quit: ",X:DTIME S:'$T X=U G:'$L(X)!(X=U) OUT I X<1!(X>4)!(X'?1N) W " ??",*7,!!,"Please enter the number corresponding to the information you seek or '^' to quit." G ASK
W !!
I X=3 G USER
I X=4 G MAILG
I $D(XQ6)&(X=1) S DIC="^DIC(19.1,",DIC(0)="AEMNQ",DIC("A")=" What key would you like to see? " D ^DIC G:Y<0 OUT S DA=+Y D EN^DIQ G OUT
I X=1 S DIC="^DIC(9.2,",DIC(0)="AEMNQ",DIC("A")=" What help frame would you like to see? " D ^DIC G:Y<0 OUT S DA=+Y D EN^DIQ G OUT
I $D(XQ6)&(X=2) S DIC="^DIC(19.1,",DIC(0)="AEMNQZ",DIC("A")=" Holders of what key? " D ^DIC G:Y<0 OUT S I=0 F XQL=0:1 S I=$O(^DIC(19.1,+Y,2,I)) G:I="" PRINT S XQU=+^(I,0) S:$D(^VA(200,+XQU,0)) X=$P(^(0),U),^TMP($J,X)=""
I X=2 S DIC="^DIC(9.2,",DIC(0)="AEMNQZ",DIC("A")=" Editors of which help frame? " D ^DIC G:Y<0 OUT S I=0 F XQL=0:1 S I=$O(^DIC(9.2,+Y,4,"AB",I)) G:I="" PRINT S:$D(^VA(200,+I,0)) X=$P(^(0),U,1),^TMP($J,X)=""
W !!,"Something's wrong...what was it you wanted again? " G ASK
Q
USER ;Look at the User File
S DIC=200,X="?",DIC(0)="AEMNQ",DIC("S")="I $L($P(^(0),U,3))",DIC("A")=" Which user would you like to examine? " D ^DIC G:Y<0 OUT S DA=+Y D EN^DIQ G OUT
Q
MAILG ;Examine a mail group
S XMDUZ=DUZ,DIC="^XMB(3.8,",DIC(0)="AEQMZ",DIC("A")=" Which mail group? " D ^DIC G:Y<0 OUT W !!," Members are: " S I=0 W !
F XQL=0:1 S I=$O(^XMB(3.8,+Y,1,I)) Q:'I S XQU=+^(I,0) S:$D(^VA(200,+XQU,0)) X=$P(^VA(200,+XQU,0),U),^TMP($J,X)=""
PRINT S XQLL=XQL,I=""
I $O(^TMP($J,I))="" W !!,?5," There is no one listed in the file.",!! G OUT
F XQL=0:XQLL S I=$O(^TMP($J,I)) Q:I="" W !,?5,I
;
OUT ;Clean up and return
K DA,DIC,I,X,Y,XQL,XQLL,XQU
Q
XQ62 ;SEA/MJM - Generalized file look-up utility ;8/2/89 09:53;5/13/93 11:53 AM [ 04/02/2003 8:29 AM ]
+1 ;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
+2 ;;8.0;KERNEL;;Jul 10, 1995
+3 SET U="^"
KILL ^TMP($JOB)
+1 WRITE !!,?10,"3. The User File",!!,?10,"4. A mail group"
+2 ;
ASK ;Get user's response, check it, and branch to subroutine
+1 READ !!,?5,"Enter a number or '^' to quit: ",X:DTIME
IF '$TEST
SET X=U
IF '$LENGTH(X)!(X=U)
GOTO OUT
IF X<1!(X>4)!(X'?1N)
WRITE " ??",*7,!!,"Please enter the number corresponding to the information you seek or '^' to quit."
GOTO ASK
+2 WRITE !!
+3 IF X=3
GOTO USER
+4 IF X=4
GOTO MAILG
+5 IF $DATA(XQ6)&(X=1)
SET DIC="^DIC(19.1,"
SET DIC(0)="AEMNQ"
SET DIC("A")=" What key would you like to see? "
DO ^DIC
IF Y<0
GOTO OUT
SET DA=+Y
DO EN^DIQ
GOTO OUT
+6 IF X=1
SET DIC="^DIC(9.2,"
SET DIC(0)="AEMNQ"
SET DIC("A")=" What help frame would you like to see? "
DO ^DIC
IF Y<0
GOTO OUT
SET DA=+Y
DO EN^DIQ
GOTO OUT
+7 IF $DATA(XQ6)&(X=2)
SET DIC="^DIC(19.1,"
SET DIC(0)="AEMNQZ"
SET DIC("A")=" Holders of what key? "
DO ^DIC
IF Y<0
GOTO OUT
SET I=0
FOR XQL=0:1
SET I=$ORDER(^DIC(19.1,+Y,2,I))
IF I=""
GOTO PRINT
SET XQU=+^(I,0)
IF $DATA(^VA(200,+XQU,0))
SET X=$PIECE(^(0),U)
SET ^TMP($JOB,X)=""
+8 IF X=2
SET DIC="^DIC(9.2,"
SET DIC(0)="AEMNQZ"
SET DIC("A")=" Editors of which help frame? "
DO ^DIC
IF Y<0
GOTO OUT
SET I=0
FOR XQL=0:1
SET I=$ORDER(^DIC(9.2,+Y,4,"AB",I))
IF I=""
GOTO PRINT
IF $DATA(^VA(200,+I,0))
SET X=$PIECE(^(0),U,1)
SET ^TMP($JOB,X)=""
+9 WRITE !!,"Something's wrong...what was it you wanted again? "
GOTO ASK
+10 QUIT
USER ;Look at the User File
+1 SET DIC=200
SET X="?"
SET DIC(0)="AEMNQ"
SET DIC("S")="I $L($P(^(0),U,3))"
SET DIC("A")=" Which user would you like to examine? "
DO ^DIC
IF Y<0
GOTO OUT
SET DA=+Y
DO EN^DIQ
GOTO OUT
+2 QUIT
MAILG ;Examine a mail group
+1 SET XMDUZ=DUZ
SET DIC="^XMB(3.8,"
SET DIC(0)="AEQMZ"
SET DIC("A")=" Which mail group? "
DO ^DIC
IF Y<0
GOTO OUT
WRITE !!," Members are: "
SET I=0
WRITE !
+2 FOR XQL=0:1
SET I=$ORDER(^XMB(3.8,+Y,1,I))
IF 'I
QUIT
SET XQU=+^(I,0)
IF $DATA(^VA(200,+XQU,0))
SET X=$PIECE(^VA(200,+XQU,0),U)
SET ^TMP($JOB,X)=""
PRINT SET XQLL=XQL
SET I=""
+1 IF $ORDER(^TMP($JOB,I))=""
WRITE !!,?5," There is no one listed in the file.",!!
GOTO OUT
+2 FOR XQL=0:XQLL
SET I=$ORDER(^TMP($JOB,I))
IF I=""
QUIT
WRITE !,?5,I
+3 ;
OUT ;Clean up and return
+1 KILL DA,DIC,I,X,Y,XQL,XQLL,XQU
+2 QUIT