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/ZUGTM.m@ 1154

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

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1ZU ;SF/JLI,RWF - For GT.M, TIE ALL TERMINALS TO THIS ROUTINE!! ;11/24/2003 11:34
2 ;;8.0;KERNEL;**275,419**;Jul 10, 1995;Build 5
3 ; for GT.M for VMS & Unix, version 4.3
4 ;
5 ;The env var ZINTRRUPT should be set to catch all interrupts.
6EN ;See that escape processing is off, Conflict with Screenman
7 U $P:(NOCENABLE:NOESCAPE)
8 N $ESTACK,$ETRAP S $ETRAP="D ERR^ZU Q:$QUIT -9 Q"
9 S $ZINTERRUPT="I $$JOBEXAM^ZU($ZPOSITION)"
10 D:+$G(^%ZTSCH("LOGRSRC")) LOGRSRC^%ZOSV("$LOGIN$")
11 D COUNT^XUSCNT(1)
12 G ^XUS
13 ;
14 ;
15ERR ;Come here on error
16 ; handle stack overflow errors specifically
17 I $P($ZS,",",3)["STACKCRIT"!("STACKOFLOW"[$P($ZS,",",3)) S $ET="Q:$ST>"_($ST-8)_" G ERR2^ZU" Q
18 ;
19ERR2 ;
20 S $ETRAP="D UNWIND^ZU" L ;Backup Trap
21 U $P:NOCENABLE
22 Q:$ECODE["<PROG>"
23 I $P($ZS,",",2,3)["^XUS1A:2, %GTM-E-IOWRITERR" G HALT
24 ;
25 D ^%ZTER K %ZT ; Capture symbol table first!
26 ;
27 I $G(IO)]"",$D(IO(1,IO)),$E($G(IOST))="P" D
28 . U IO
29 . W @$S($D(IOF):IOF,1:"#")
30 I $G(IO(0))]"" D
31 . U IO(0)
32 . W !!,"RECORDING THAT AN ERROR OCCURRED ---"
33 . W !!?15,"Sorry 'bout that"
34 . W !,*7
35 . W !?10,"$STACK=",$STACK," $ECODE=",$ECODE
36 . W !?10,"$ZSTATUS=",$ZSTATUS
37 ;
38 ;
39 I $G(DUZ)'>0 G HALT
40 S $ET="D HALT^ZU"
41 ;
42 I $P($ZS,",",3)'["-CTRLC" S XUERF="" G ^XUSCLEAN ;419
43CTRLC U $P
44 W !,"--Interrupt Acknowledged",!
45 D KILL1^XUSCLEAN ;Clean up symbol table
46 S $ECODE=",<<POP>>,"
47 Q
48 ;
49UNWIND ;Unwind the stack
50 Q:$ESTACK>1 G CTRLC2:$ECODE["<<POP>>"
51 S $ECODE=""
52 Q
53 ;
54CTRLC2 S $ECODE="" G:$G(^XUTL("XQ",$J,"T"))<2 ^XUSCLEAN
55 S ^XUTL("XQ",$J,"T")=1,XQY=$G(^(1)),XQY0=$P(XQY,"^",2,99)
56 G:$P(XQY0,"^",4)'="M" HALT
57 S XQPSM=$P(XQY,"^",1),XQY=+XQPSM,XQPSM=$P(XQPSM,XQY,2,3)
58 G:'XQY ^XUSCLEAN
59 S $ECODE="",$ETRAP="D ERR^ZU Q:$QUIT 0 Q"
60 U $P:NOESCAPE
61 G M1^XQ
62 ;
63HALT I $D(^XUTL("XQ",$J)) D:$G(DUZ)>0 BYE^XUSCLEAN
64 D COUNT^XUSCNT(-1)
65 D:+$G(^%ZTSCH("LOGRSRC")) LOGRSRC^%ZOSV("$LOGOUT$")
66 HALT
67 ;
68JOBEXAM(%ZPOS) ;
69 N %reference S %reference=$REFERENCE
70 S ^XUTL("XUSYS",$J,0)=$H,^XUTL("XUSYS",$J,"INTERRUPT")=$G(%ZPOS)
71 I %ZPOS["^" S ^XUTL("XUSYS",$J,"codeline")=$T(@%ZPOS)
72 K ^XUTL("XUSYS",$J,"JE")
73 I $G(^XUTL("XUSYS","COMMAND"))'="EXAM" ZSHOW "SD":^XUTL("XUSYS",$J,"JE")
74 I $G(^XUTL("XUSYS","COMMAND"))="EXAM" ZSHOW "*":^XUTL("XUSYS",$J,"JE")
75 I $G(^XUTL("XUSYS",$J,"CMD"))="HALT" ;To do.
76 Q 1
77 ;
Note: See TracBrowser for help on using the repository browser.