SCMCRU ;ALB/REW - PCMM Report Utilities ; 9 Feb 1996
;;5.3;Scheduling;**41**;AUG 13, 1993
;FORM FEED & STOPPING UTILITIES
FIRST() ;First heading of report
; RETURNS STOP; 0=GO,1=STOP
N STOP
D STOPCHK
D:$G(STOP) STOPPED
I '$G(STOP),$E($G(IOST),1,2)="C-" W @IOF
Q $G(STOP)
;
SUBSEQ() ;enter for further headings of report
; RETURNS STOP; 0=GO,1=STOP
N STOP,DIR,X,Y
D STOPCHK
I $E($G(IOST),1,2)="C-" S DIR(0)="E" D ^DIR S:$D(DIRUT) STOP=1
D:$G(STOP) STOPPED
I '$G(STOP) W @IOF
Q $G(STOP)
;
STOPCHK I $D(ZTQUEUED),$$S^%ZTLOAD S (ZTSTOP,STOP)=1
Q
STOPPED ;
W !?5,"------------- Report stopped at user's request ------------"
K ZTREQ
Q
ENDREP I $E(IOST,1,2)'["C-" W:$Y&'$D(IONOFF) @IOF Q
;
; print SCFOOT
;RETURNS SCSTOP=1 IF STOP CALLED FOR
S SCPAGE=$G(SCPAGE)+1
F I=$Y:1:$S($D(IOSL):(IOSL-5),1:61) W !
W !,$G(SCFOOT),?66,"PAGE: ",SCPAGE
S SCSTOP=$$SUBSEQ
I SCSTOP D STOPPED
Q
; prints SCHEAD
W !,$G(SCHEAD)
Q
WAIT I $E(IOST)="C" S DIR(0)="E" D ^DIR S:'Y SCSTOP=1
Q
;
OUT(LINE,FORMAT) ;
W:$D(FORMAT) @FORMAT
W $G(LINE)
I $Y>(IOSL-4) D FOOTER D HEADER
QTOUT Q
;
DDNAME(FILE,FIELD) ;return the fieldname
N SCX
D FIELD^DID(FILE,FIELD,"","LABEL","SCX")
Q $G(SCX("LABEL"))
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSCMCRU 1285 printed Dec 13, 2024@02:41:21 Page 2
SCMCRU ;ALB/REW - PCMM Report Utilities ; 9 Feb 1996
+1 ;;5.3;Scheduling;**41**;AUG 13, 1993
+2 ;FORM FEED & STOPPING UTILITIES
FIRST() ;First heading of report
+1 ; RETURNS STOP; 0=GO,1=STOP
+2 NEW STOP
+3 DO STOPCHK
+4 if $GET(STOP)
DO STOPPED
+5 IF '$GET(STOP)
IF $EXTRACT($GET(IOST),1,2)="C-"
WRITE @IOF
+6 QUIT $GET(STOP)
+7 ;
SUBSEQ() ;enter for further headings of report
+1 ; RETURNS STOP; 0=GO,1=STOP
+2 NEW STOP,DIR,X,Y
+3 DO STOPCHK
+4 IF $EXTRACT($GET(IOST),1,2)="C-"
SET DIR(0)="E"
DO ^DIR
if $DATA(DIRUT)
SET STOP=1
+5 if $GET(STOP)
DO STOPPED
+6 IF '$GET(STOP)
WRITE @IOF
+7 QUIT $GET(STOP)
+8 ;
STOPCHK IF $DATA(ZTQUEUED)
IF $$S^%ZTLOAD
SET (ZTSTOP,STOP)=1
+1 QUIT
STOPPED ;
+1 WRITE !?5,"------------- Report stopped at user's request ------------"
+2 KILL ZTREQ
+3 QUIT
ENDREP IF $EXTRACT(IOST,1,2)'["C-"
if $Y&'$DATA(IONOFF)
WRITE @IOF
QUIT
+1 ;
+1 ; print SCFOOT
+2 ;RETURNS SCSTOP=1 IF STOP CALLED FOR
+3 SET SCPAGE=$GET(SCPAGE)+1
+4 FOR I=$Y:1:$SELECT($DATA(IOSL):(IOSL-5),1:61)
WRITE !
+5 WRITE !,$GET(SCFOOT),?66,"PAGE: ",SCPAGE
+6 SET SCSTOP=$$SUBSEQ
+7 IF SCSTOP
DO STOPPED
+8 QUIT
+1 ; prints SCHEAD
+2 WRITE !,$GET(SCHEAD)
+3 QUIT
WAIT IF $EXTRACT(IOST)="C"
SET DIR(0)="E"
DO ^DIR
if 'Y
SET SCSTOP=1
+1 QUIT
+2 ;
OUT(LINE,FORMAT) ;
+1 if $DATA(FORMAT)
WRITE @FORMAT
+2 WRITE $GET(LINE)
+3 IF $Y>(IOSL-4)
DO FOOTER
DO HEADER
QTOUT QUIT
+1 ;
DDNAME(FILE,FIELD) ;return the fieldname
+1 NEW SCX
+2 DO FIELD^DID(FILE,FIELD,"","LABEL","SCX")
+3 QUIT $GET(SCX("LABEL"))
+4 ;