source: WorldVistAEHR/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XUTMQ1.m@ 1800

Last change on this file since 1800 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1XUTMQ1 ;SEA/RDS - TaskMan: Option, ZTMINQ, Part 3 (Modules) ;4/20/95 10:33
2 ;;8.0;KERNEL;;Jul 10, 1995
3 ;
4ENTRY G ^XUTMQ
5 ;
6PRINT ;Subroutine--Print A Task
7 N XUTMT,ZTSK W:'ZTC @IOF,!,ZTH,! W:'ZTF !,"-------------------------------------------------------------------------------"
8 S X=0,ZTF=0 D EN^XUTMTP(ZTS) I $Y>18 W ! S ZTF=1,DIR(0)="E" D ^DIR S X=$D(DTOUT)!$D(DUOUT) Q:X W @IOF
9 S ZTC=ZTC+1 Q
10 ;
11RANGE ;LIST--Process A Range
12 S ZT1=$P(ZT,"-"),ZT2=$P(ZT,"-",2),ZTS=ZT1 I $D(^%ZTSK(ZTS))!($D(^%ZTSCH("TASK",ZTS))) D PRINT Q:X
13 F ZTJ=0:0 S ZTS=$O(^%ZTSCH("TASK",ZTS)) Q:ZTS=""!(ZTS>ZT2) I '$D(^%ZTSK(ZTS)) D PRINT Q:X
14 Q:X S ZTS=ZT1 F ZTJ=0:0 S ZTS=$O(^%ZTSK(ZTS)) Q:ZTS>ZT2!'ZTS D PRINT Q:X
15 Q
16 ;
17OUT ;Tag for breaking FOR scope to exit listing early
18 Q
19 ;
20EVERY ;Every task.
21 N DIR,DIRUT,DTOUT,DUOUT,X,ZT1,ZT2,ZTC,ZTF,ZTH,ZTREC,ZTS
22 K ^TMP($J)
23 S ZTC=0,ZTF=1,ZTH="Every task..."
24 W !!,"Building list of sorted tasks..."
25 ;
26E1 S ZTS=0 F S ZTS=$O(^%ZTSK(ZTS)) Q:'ZTS D
27 .S ZTREC=$G(^%ZTSK(ZTS,0)) Q:'$L(ZTREC)
28 . D SORT(+$P(ZTREC,U,6),ZTS)
29 .Q
30 ;
31E2 S ZTS=0 F S ZTS=$O(^%ZTSCH("TASK",ZTS)) Q:'ZTS D
32 .I $D(^%ZTSK(ZTS)) Q
33 . D SORT($H,ZTS) ;S ^TMP($J,99999-$H,99999-$P($H,",",2),ZTS)=""
34 .Q
35 W "finished!"
36 ;
37E3 ;
38 G:$O(^TMP($J,0))="" E4
39 S ZTSAVE("^TMP($J,")="" D EN^XUTMDEVQ("LIST^XUTMQ","TASK LIST",.ZTSAVE)
40 K ^TMP($J)
41 Q
42 S ZT1="" F S ZT1=$O(^TMP($J,ZT1),-1) Q:ZT1="" D I X Q
43 . S ZTS=0 F S ZTS=$O(^TMP($J,ZT1,ZTS)) Q:'ZTS D PRINT I X Q
44 .Q
45 I X K ^TMP($J) Q
46 ;
47E4 I 'ZTC W !!,"This volume set has no defined tasks!"
48 W ! S DIR(0)="E",DIR("A")="Press RETURN to continue" D
49 .I ZTC S DIR("A")="End of listing. "_DIR("A")
50 D ^DIR K ^TMP($J) Q
51 ;
52LIST ;List of tasks.
53 N DIR,DIRUT,DTOUT,DUOUT,X,ZT,ZT1,ZT2,ZTC,ZTF,ZTH,ZTI,ZTJ,XUTMT,ZTS,ZTSK
54L0 S XUTMT(0)="AL",XUTMT("A")="Enter list to display: ",XUTMT("??")="@" D ^XUTMT K ^TMP($J,"XUTMT") Q:ZTSK="" S X=0,ZTC=0,ZTF=1,ZTH="All tasks within the list "_ZTSK_"..."
55 F ZTI=1:1:$L(ZTSK,",") S ZT=$P(ZTSK,",",ZTI) D RANGE:ZT["-" G OUT:X I ZT'["-",$D(^%ZTSK(ZT))!($D(^%ZTSCH("TASK",ZT))) S ZTS=ZT D PRINT G OUT:X
56 I ZTC W !!,"There ",$S(ZTC=1:"is ",1:"are "),ZTC," task",$S(ZTC=1:"",1:"s")," in that list."
57 I 'ZTC W !!?5,$S(ZTSK["-"!(ZTSK[","):"None of those tasks are ",1:"That task is not "),"defined in this volume set's Task File."
58 K DIR,DIRUT,DTOUT,DUOUT,X,ZT,ZT1,ZT2,ZTC,ZTF,ZTI,ZTJ,XUTMT,ZTS,ZTSK W ! G L0
59 ;
60NOT ;Unsuccessful tasks.
61 N DIR,DIRUT,DTOUT,DUOUT,X,ZT1,ZT2,ZTC,ZTF,ZTH,ZTS,ZTSCREEN,ZTSK
62 K ^TMP($J)
63 S X=0,ZTH="Unsuccessful tasks...",ZTC=0,ZTF=1
64 W !!,"Searching for unsuccessful tasks..."
65 ;
66N1 S ZTS=0 F S ZTS=$O(^%ZTSK(ZTS)) Q:'ZTS D
67 .I $D(^%ZTSK(ZTS,0))[0 Q
68 .I $D(^%ZTSK(ZTS,.1))[0 Q
69 .I "BCDEFIL"'[$P(^%ZTSK(ZTS,.1),U) Q
70 .S XUTMT=ZTS,XUTMT(0)="L" D ^XUTMT
71 .I '$D(ZTSK("A")),'$D(ZTSK("IO")),'$D(ZTSK("JOB")),'$D(ZTSK("LINK")),'$D(ZTSK("TASK")) D SORT(+$P(ZTSK(0),U,6),ZTS)
72 .Q
73 W "Finished!",!
74 ;
75N2 ;
76 G:$O(^TMP($J,0))="" N3
77 S ZTSAVE("^TMP($J,")="" D EN^XUTMDEVQ("LIST^XUTMQ","TASK LIST",.ZTSAVE)
78 K ^TMP($J)
79 Q
80 S ZT1="" F S ZT1=$O(^TMP($J,ZT1),-1) Q:ZT1="" D I X Q
81 . S ZTS=0 F S ZTS=$O(^TMP($J,ZT1,ZTS)) Q:'ZTS D I X Q
82 .. D PRINT
83 .Q
84 I X K ^TMP($J) Q
85 ;
86N3 I 'ZTC W !!,"No tasks failed to run to completion."
87 W ! S DIR(0)="E",DIR("A")="Press RETURN to continue" D
88 .I ZTC S DIR("A")="End of listing. "_DIR("A")
89 D ^DIR K ^TMP($J) Q
90 ;
91SORT(ZTDTH,ZTSK) ;
92 Q:(ZTSK'>0)!(ZTDTH'>0)
93 I ZTDTH["," S ZTDTH=$$H3^%ZTM(ZTDTH)
94 S ^TMP($J,ZTDTH,ZTSK)=""
95 Q
Note: See TracBrowser for help on using the repository browser.