XUTMRJD1 ;SEA/RDS - TaskMan: Option, XURESJOB Exit Action, Part 2 ;11/8/94 09:12
;;8.0;KERNEL;;Jul 10, 1995
HELP1A ;
;PROMPT1^XUTMRJD--? help
W !!?5,"Answer yes or no. Enter ?? for more help."
Q
HELP1B ;
;PROMPT1^XUTMRJD--explain purpose and offer to show Task List
N DIR,DIRUT,DTOUT,DUOUT,X,Y
W !!?5,"If you answer yes, you will be asked to identify the tasks"
W !?5,"you forcibly exited."
W !!?5,"If you answer no, you will exit the option."
W !!?5,"If you are not sure, answer yes. At the next prompt, you"
W !?5,"can enter ?TASK LIST to see the list of tasks TaskMan believes"
W !?5,"are running, which may help you identify tasks you may have"
W !?5,"forcibly exited."
Q
HELP2A ;
;PROMPT2^XUTMRJD--? help
I $D(ZTSCREEN) K ZTSCREEN Q
W !!?5,"Answer must be the internal number(s) of the task(s) to be"
W !?5,"selected."
W !!?5,"Answer must be an integer between 1 and 999999999."
W !?5,"Answer may be a range, for example 4000-5000."
W !?5,"Answer may be a list, for example 4001,4004,4010-4020."
W !!?5,"Enter ?? for more help."
Q
HELP2B ;
;PROMPT2^XUTMRJD--explain, offer to show system status or Task List
W !!?5,"Enter ?TASK LIST (or ?T) to list the tasks TaskMan believes"
W !?5,"are running."
W !!?5,"Enter ?SYSTEM STATUS (or ?S) to list the system status report."
Q
SCREEN2A ;
;PROMPT2^XUTMRJD--screen out ?TASK LIST and ?SYSTEM STATUS as acceptable
N ZTL,ZTX
S ZTX=$$UP^XLFSTR(X)
S ZTL=$L(X)
I $E("?TASK LIST",1,ZTL)=ZTX D Q
.W $E("?TASK LIST",ZTL+1,999)
.S Y="?TASK LIST",ZTOUT=1
.Q
I $E("?SYSTEM STATUS",1,ZTL)=ZTX D Q
.W $E("?SYSTEM STATUS",ZTL+1,999)
.S Y="?SYSTEM STATUS",ZTOUT=1
.Q
Q
;
SCREEN2B ;
;PROMPT2^XUTMRJD--screen out lists w/o any running tasks as unacceptable
N ZTCOUNT,ZTR1,ZTR2,ZTSK
S ZTCOUNT=0 K ^TMP($J,"XUTMRJD")
S2B1 ;
S ZTSK=0 F S ZTSK=$O(^%ZTSCH("TASK",ZTSK)) Q:'ZTSK D
.I $D(^TMP($J,"XUTMT",ZTSK)) D Q
..S ZTCOUNT=ZTCOUNT+1
..S ^TMP($J,"XUTMRJD",ZTSK)=""
.S ZTR2=$O(^TMP($J,"XUTMT",ZTSK))
.S ZTR1=$O(^TMP($J,"XUTMT",ZTSK))
.I ZTR1="" Q
.I ZTR1>ZTSK Q
.S ZTCOUNT=ZTCOUNT+1
.S ^TMP($J,"XUTMRJD",ZTSK)=""
.Q
S2B2 ;
I ZTCOUNT S ^TMP($J,"XUTMRJD")=ZTCOUNT Q
W !!?5,"None of the tasks in that range are listed as running."
W !!?5,"You must select from TaskMan's list of running tasks if you"
W !?5,"want TaskMan to remove the ones you forcibly exited."
W !!?5,"Enter ? for help."
K X S ZTSCREEN=1
Q
HELP3A ;
;PROMPT3^XUTMRJD--? help
W !!?5,"Answer yes or no. Enter ?? for more help."
Q
HELP3B ;
;PROMPT3^XUTMRJD--explain consequences
W !!?5,"Answer yes if before continuing you want to see the task",ZTPLURAL
W !?5,"you have selected."
W !!?5,"Answer no if you are sure which task",ZTPLURAL," you selected."
Q
HELP4A ;
;PROMPT4^XUTMRJD--? help
W !!?5,"Answer yes or no. Enter ?? for more help."
Q
HELP4B ;
;PROMPT4^XUTMRJD--explain consequences
W !!?5,"Answer yes to remove the selected task",ZTPLURAL
W " from TaskMan's list"
W !?5,"of running tasks. If you do, TaskMan will no longer believe"
I ZTCOUNT>1 W !?5,"these tasks are running."
E W !?5,"this task is running."
W !!?5,"Answer no to leave the task",ZTPLURAL," listed as running."
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXUTMRJD1 3266 printed Oct 16, 2024@18:14:24 Page 2
XUTMRJD1 ;SEA/RDS - TaskMan: Option, XURESJOB Exit Action, Part 2 ;11/8/94 09:12
+1 ;;8.0;KERNEL;;Jul 10, 1995
HELP1A ;
+1 ;PROMPT1^XUTMRJD--? help
+2 WRITE !!?5,"Answer yes or no. Enter ?? for more help."
+3 QUIT
HELP1B ;
+1 ;PROMPT1^XUTMRJD--explain purpose and offer to show Task List
+2 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+3 WRITE !!?5,"If you answer yes, you will be asked to identify the tasks"
+4 WRITE !?5,"you forcibly exited."
+5 WRITE !!?5,"If you answer no, you will exit the option."
+6 WRITE !!?5,"If you are not sure, answer yes. At the next prompt, you"
+7 WRITE !?5,"can enter ?TASK LIST to see the list of tasks TaskMan believes"
+8 WRITE !?5,"are running, which may help you identify tasks you may have"
+9 WRITE !?5,"forcibly exited."
+10 QUIT
HELP2A ;
+1 ;PROMPT2^XUTMRJD--? help
+2 IF $DATA(ZTSCREEN)
KILL ZTSCREEN
QUIT
+3 WRITE !!?5,"Answer must be the internal number(s) of the task(s) to be"
+4 WRITE !?5,"selected."
+5 WRITE !!?5,"Answer must be an integer between 1 and 999999999."
+6 WRITE !?5,"Answer may be a range, for example 4000-5000."
+7 WRITE !?5,"Answer may be a list, for example 4001,4004,4010-4020."
+8 WRITE !!?5,"Enter ?? for more help."
+9 QUIT
HELP2B ;
+1 ;PROMPT2^XUTMRJD--explain, offer to show system status or Task List
+2 WRITE !!?5,"Enter ?TASK LIST (or ?T) to list the tasks TaskMan believes"
+3 WRITE !?5,"are running."
+4 WRITE !!?5,"Enter ?SYSTEM STATUS (or ?S) to list the system status report."
+5 QUIT
SCREEN2A ;
+1 ;PROMPT2^XUTMRJD--screen out ?TASK LIST and ?SYSTEM STATUS as acceptable
+2 NEW ZTL,ZTX
+3 SET ZTX=$$UP^XLFSTR(X)
+4 SET ZTL=$LENGTH(X)
+5 IF $EXTRACT("?TASK LIST",1,ZTL)=ZTX
Begin DoDot:1
+6 WRITE $EXTRACT("?TASK LIST",ZTL+1,999)
+7 SET Y="?TASK LIST"
SET ZTOUT=1
+8 QUIT
End DoDot:1
QUIT
+9 IF $EXTRACT("?SYSTEM STATUS",1,ZTL)=ZTX
Begin DoDot:1
+10 WRITE $EXTRACT("?SYSTEM STATUS",ZTL+1,999)
+11 SET Y="?SYSTEM STATUS"
SET ZTOUT=1
+12 QUIT
End DoDot:1
QUIT
+13 QUIT
+14 ;
SCREEN2B ;
+1 ;PROMPT2^XUTMRJD--screen out lists w/o any running tasks as unacceptable
+2 NEW ZTCOUNT,ZTR1,ZTR2,ZTSK
+3 SET ZTCOUNT=0
KILL ^TMP($JOB,"XUTMRJD")
S2B1 ;
+1 SET ZTSK=0
FOR
SET ZTSK=$ORDER(^%ZTSCH("TASK",ZTSK))
if 'ZTSK
QUIT
Begin DoDot:1
+2 IF $DATA(^TMP($JOB,"XUTMT",ZTSK))
Begin DoDot:2
+3 SET ZTCOUNT=ZTCOUNT+1
+4 SET ^TMP($JOB,"XUTMRJD",ZTSK)=""
End DoDot:2
QUIT
+5 SET ZTR2=$ORDER(^TMP($JOB,"XUTMT",ZTSK))
+6 SET ZTR1=$ORDER(^TMP($JOB,"XUTMT",ZTSK))
+7 IF ZTR1=""
QUIT
+8 IF ZTR1>ZTSK
QUIT
+9 SET ZTCOUNT=ZTCOUNT+1
+10 SET ^TMP($JOB,"XUTMRJD",ZTSK)=""
+11 QUIT
End DoDot:1
S2B2 ;
+1 IF ZTCOUNT
SET ^TMP($JOB,"XUTMRJD")=ZTCOUNT
QUIT
+2 WRITE !!?5,"None of the tasks in that range are listed as running."
+3 WRITE !!?5,"You must select from TaskMan's list of running tasks if you"
+4 WRITE !?5,"want TaskMan to remove the ones you forcibly exited."
+5 WRITE !!?5,"Enter ? for help."
+6 KILL X
SET ZTSCREEN=1
+7 QUIT
HELP3A ;
+1 ;PROMPT3^XUTMRJD--? help
+2 WRITE !!?5,"Answer yes or no. Enter ?? for more help."
+3 QUIT
HELP3B ;
+1 ;PROMPT3^XUTMRJD--explain consequences
+2 WRITE !!?5,"Answer yes if before continuing you want to see the task",ZTPLURAL
+3 WRITE !?5,"you have selected."
+4 WRITE !!?5,"Answer no if you are sure which task",ZTPLURAL," you selected."
+5 QUIT
HELP4A ;
+1 ;PROMPT4^XUTMRJD--? help
+2 WRITE !!?5,"Answer yes or no. Enter ?? for more help."
+3 QUIT
HELP4B ;
+1 ;PROMPT4^XUTMRJD--explain consequences
+2 WRITE !!?5,"Answer yes to remove the selected task",ZTPLURAL
+3 WRITE " from TaskMan's list"
+4 WRITE !?5,"of running tasks. If you do, TaskMan will no longer believe"
+5 IF ZTCOUNT>1
WRITE !?5,"these tasks are running."
+6 IF '$TEST
WRITE !?5,"this task is running."
+7 WRITE !!?5,"Answer no to leave the task",ZTPLURAL," listed as running."
+8 QUIT
+9 ;