FSCRUDQ ;SLC/STAFF-NOIS Report Utility Dequeued ;6/16/95 14:35
;;1.1;NOIS;;Sep 06, 1998
;
DQPT ;
N CNT,HDR,LINE,OK,PAGE,TOTPAGE K HDR
D
.I $G(PAGEBRK) D PAGE Q
.D ALL
I $D(ZTQUEUED) D CLEANUP^FSCOPTU
Q
;
DQPS ;
N BG,CNT,LINE,LINECNT,LINES,OK,PAGE,TITLE,TOTPAGE
U IO I $D(ZTQUEUED) S ZTREQ="@"
S BG=$G(VALMBG,1),LINES=$G(VALM("LINES"),16),TITLE=$G(VALM("TITLE"),"NOIS")
S PAGE=(BG\LINES)+((BG#LINES)>0),LINECNT=+$P(@VALMAR,U,2),TOTPAGE=(LINECNT\LINES)+((LINECNT#LINES)>0)
S LINECNT=0 I IOST["C-" W @IOF
S LINECNT=LINECNT+1 W !,TITLE,?28,$$FMTE^XLFDT($$NOW^XLFDT)," Page: ",PAGE," of ",$J(TOTPAGE,6)
S LINE=0 F S LINE=$O(VALMHDR(LINE)) Q:LINE<1 S LINECNT=LINECNT+1 W !,VALMHDR(LINE)
S LINECNT=LINECNT+1 W !,VALMCAP
S LINECNT=LINECNT+1,LINE="",$P(LINE,"-",79)="" W !,LINE
S CNT=0,LINE=BG-1 F S LINE=$O(@VALMAR@(LINE)) Q:LINE<1 S CNT=CNT+1 Q:CNT>LINES S LINECNT=LINECNT+1 W !,$E(@VALMAR@(LINE,0),1,79)
I IOST["C-" D
.F S LINECNT=LINECNT+1 Q:LINECNT>25 W ! I $Y'<(IOSL-2) Q
.D PAUSE^FSCU(.OK)
I $D(ZTQUEUED) D CLEANUP^FSCOPTU
Q
;
DQ ;
D SETUP^FSCRPTS I $D(VALMQUIT) Q
N CNT,HDR,LINE,OK,PAGE,TOTPAGE K HDR
S LISTREF=VALMAR,LISTSEL="VVALUES" M FSCFMT=FSCSTYLE D ENTRY^FSCLMV,HEADER^FSCLMV
D
.I $G(PAGEBRK) D PAGE Q
.D ALL
I $D(ZTQUEUED) D CLEANUP^FSCOPTU
Q
;
ALL ;
D SETUP(+$P(@VALMAR,U,2),.HDR,.TOTPAGE)
U IO I $D(ZTQUEUED) S ZTREQ="@"
I '$O(@VALMAR@(0)) S (CNT,PAGE)=0 D HEADER(.PAGE,.HDR,.CNT,.OK) W !!,"No calls to view." Q
S OK=1,(CNT,PAGE,LINE)=0 F S LINE=$O(@VALMAR@(LINE)) Q:LINE<1 D I 'OK Q
.I CNT=0 D HEADER(.PAGE,.HDR,.CNT,.OK) I 'OK Q
.S CNT=CNT+1 W !,$E($G(@VALMAR@(LINE,0)),1,79)
.I $Y'<(IOSL-2) S CNT=0 I IOST["C-" D PAUSE^FSCU(.OK)
I CNT D
.F S CNT=CNT+1 Q:CNT>25 W ! I $Y'<(IOSL-2) Q
.I IOST["C-" D PAUSE^FSCU(.OK)
Q
;
PAGE ;
D SETUP(+$P(@VALMAR,U,2),.HDR,.TOTPAGE)
U IO I $D(ZTQUEUED) S ZTREQ="@"
I '$O(@VALMAR@(0)) S (CNT,PAGE)=0 D HEADER(.PAGE,.HDR,.CNT,.OK) W !!,"No calls to view." Q
N DIVIDER S DIVIDER="",$P(DIVIDER,"=",80)=""
S OK=1,(CNT,PAGE,LINE)=0 F S LINE=$O(@VALMAR@(LINE)) Q:LINE<1 D I 'OK Q
.I CNT=0 D HEADER(.PAGE,.HDR,.CNT,.OK) I 'OK Q
.S CNT=CNT+1 W !,$E($G(@VALMAR@(LINE,0)),1,79)
.I $G(@VALMAR@(LINE,0))=DIVIDER D Q
..F S CNT=CNT+1 Q:CNT>25 W ! I $Y'<(IOSL-2) Q
..S CNT=0 I IOST["C-" D PAUSE^FSCU(.OK)
.I $Y'<(IOSL-2) S CNT=0 I IOST["C-" D PAUSE^FSCU(.OK)
I CNT D
.F S CNT=CNT+1 Q:CNT>25 W ! I $Y'<(IOSL-2) Q
.I IOST["C-" D PAUSE^FSCU(.OK)
Q
;
SETUP(LINECNT,HDR,TOTPAGE) ;
N CNT,LINE K HDR
S CNT=1,LINE=0 F S LINE=$O(VALMHDR(LINE)) Q:LINE<1 S CNT=CNT+1,HDR(CNT)=VALMHDR(LINE)
I $L($G(VALMCAP)) S CNT=CNT+1,HDR(CNT)=VALMCAP
S CNT=CNT+1,HDR(CNT)="",$P(HDR(CNT),"-",79)=""
S TOTPAGE=(LINECNT\(IOSL-CNT-2))+((LINECNT#(IOSL-CNT-2))>0)
S HDR(1)=$$SETSTR^VALM1($$FMTE^XLFDT($$NOW^XLFDT)_" Page:@@@@@@"_$S('$G(PAGEBRK):" of "_$J(TOTPAGE,6),1:""),$G(VALM("TITLE"),"NOIS"),30,51)
Q
;
N LINE S OK=1,PAGE=PAGE+1
W:'(PAGE=1&(IOST'["C-")) @IOF W $$REPLACE^FSCRU(HDR(1),"@@@@@@",$J(PAGE,6))
S LINE=1 F S LINE=$O(HDR(LINE)) Q:LINE<1 S CNT=CNT+1 W !,HDR(LINE)
I $$S^%ZTLOAD S OK=0,ZTSTOP=1 W !!,"Report has been stopped.",!
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCRUDQ 3264 printed Oct 16, 2024@18:20:45 Page 2
FSCRUDQ ;SLC/STAFF-NOIS Report Utility Dequeued ;6/16/95 14:35
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
DQPT ;
+1 NEW CNT,HDR,LINE,OK,PAGE,TOTPAGE
KILL HDR
+2 Begin DoDot:1
+3 IF $GET(PAGEBRK)
DO PAGE
QUIT
+4 DO ALL
End DoDot:1
+5 IF $DATA(ZTQUEUED)
DO CLEANUP^FSCOPTU
+6 QUIT
+7 ;
DQPS ;
+1 NEW BG,CNT,LINE,LINECNT,LINES,OK,PAGE,TITLE,TOTPAGE
+2 USE IO
IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+3 SET BG=$GET(VALMBG,1)
SET LINES=$GET(VALM("LINES"),16)
SET TITLE=$GET(VALM("TITLE"),"NOIS")
+4 SET PAGE=(BG\LINES)+((BG#LINES)>0)
SET LINECNT=+$PIECE(@VALMAR,U,2)
SET TOTPAGE=(LINECNT\LINES)+((LINECNT#LINES)>0)
+5 SET LINECNT=0
IF IOST["C-"
WRITE @IOF
+6 SET LINECNT=LINECNT+1
WRITE !,TITLE,?28,$$FMTE^XLFDT($$NOW^XLFDT)," Page: ",PAGE," of ",$JUSTIFY(TOTPAGE,6)
+7 SET LINE=0
FOR
SET LINE=$ORDER(VALMHDR(LINE))
if LINE<1
QUIT
SET LINECNT=LINECNT+1
WRITE !,VALMHDR(LINE)
+8 SET LINECNT=LINECNT+1
WRITE !,VALMCAP
+9 SET LINECNT=LINECNT+1
SET LINE=""
SET $PIECE(LINE,"-",79)=""
WRITE !,LINE
+10 SET CNT=0
SET LINE=BG-1
FOR
SET LINE=$ORDER(@VALMAR@(LINE))
if LINE<1
QUIT
SET CNT=CNT+1
if CNT>LINES
QUIT
SET LINECNT=LINECNT+1
WRITE !,$EXTRACT(@VALMAR@(LINE,0),1,79)
+11 IF IOST["C-"
Begin DoDot:1
+12 FOR
SET LINECNT=LINECNT+1
if LINECNT>25
QUIT
WRITE !
IF $Y'<(IOSL-2)
QUIT
+13 DO PAUSE^FSCU(.OK)
End DoDot:1
+14 IF $DATA(ZTQUEUED)
DO CLEANUP^FSCOPTU
+15 QUIT
+16 ;
DQ ;
+1 DO SETUP^FSCRPTS
IF $DATA(VALMQUIT)
QUIT
+2 NEW CNT,HDR,LINE,OK,PAGE,TOTPAGE
KILL HDR
+3 SET LISTREF=VALMAR
SET LISTSEL="VVALUES"
MERGE FSCFMT=FSCSTYLE
DO ENTRY^FSCLMV
DO HEADER^FSCLMV
+4 Begin DoDot:1
+5 IF $GET(PAGEBRK)
DO PAGE
QUIT
+6 DO ALL
End DoDot:1
+7 IF $DATA(ZTQUEUED)
DO CLEANUP^FSCOPTU
+8 QUIT
+9 ;
ALL ;
+1 DO SETUP(+$PIECE(@VALMAR,U,2),.HDR,.TOTPAGE)
+2 USE IO
IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+3 IF '$ORDER(@VALMAR@(0))
SET (CNT,PAGE)=0
DO HEADER(.PAGE,.HDR,.CNT,.OK)
WRITE !!,"No calls to view."
QUIT
+4 SET OK=1
SET (CNT,PAGE,LINE)=0
FOR
SET LINE=$ORDER(@VALMAR@(LINE))
if LINE<1
QUIT
Begin DoDot:1
+5 IF CNT=0
DO HEADER(.PAGE,.HDR,.CNT,.OK)
IF 'OK
QUIT
+6 SET CNT=CNT+1
WRITE !,$EXTRACT($GET(@VALMAR@(LINE,0)),1,79)
+7 IF $Y'<(IOSL-2)
SET CNT=0
IF IOST["C-"
DO PAUSE^FSCU(.OK)
End DoDot:1
IF 'OK
QUIT
+8 IF CNT
Begin DoDot:1
+9 FOR
SET CNT=CNT+1
if CNT>25
QUIT
WRITE !
IF $Y'<(IOSL-2)
QUIT
+10 IF IOST["C-"
DO PAUSE^FSCU(.OK)
End DoDot:1
+11 QUIT
+12 ;
PAGE ;
+1 DO SETUP(+$PIECE(@VALMAR,U,2),.HDR,.TOTPAGE)
+2 USE IO
IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+3 IF '$ORDER(@VALMAR@(0))
SET (CNT,PAGE)=0
DO HEADER(.PAGE,.HDR,.CNT,.OK)
WRITE !!,"No calls to view."
QUIT
+4 NEW DIVIDER
SET DIVIDER=""
SET $PIECE(DIVIDER,"=",80)=""
+5 SET OK=1
SET (CNT,PAGE,LINE)=0
FOR
SET LINE=$ORDER(@VALMAR@(LINE))
if LINE<1
QUIT
Begin DoDot:1
+6 IF CNT=0
DO HEADER(.PAGE,.HDR,.CNT,.OK)
IF 'OK
QUIT
+7 SET CNT=CNT+1
WRITE !,$EXTRACT($GET(@VALMAR@(LINE,0)),1,79)
+8 IF $GET(@VALMAR@(LINE,0))=DIVIDER
Begin DoDot:2
+9 FOR
SET CNT=CNT+1
if CNT>25
QUIT
WRITE !
IF $Y'<(IOSL-2)
QUIT
+10 SET CNT=0
IF IOST["C-"
DO PAUSE^FSCU(.OK)
End DoDot:2
QUIT
+11 IF $Y'<(IOSL-2)
SET CNT=0
IF IOST["C-"
DO PAUSE^FSCU(.OK)
End DoDot:1
IF 'OK
QUIT
+12 IF CNT
Begin DoDot:1
+13 FOR
SET CNT=CNT+1
if CNT>25
QUIT
WRITE !
IF $Y'<(IOSL-2)
QUIT
+14 IF IOST["C-"
DO PAUSE^FSCU(.OK)
End DoDot:1
+15 QUIT
+16 ;
SETUP(LINECNT,HDR,TOTPAGE) ;
+1 NEW CNT,LINE
KILL HDR
+2 SET CNT=1
SET LINE=0
FOR
SET LINE=$ORDER(VALMHDR(LINE))
if LINE<1
QUIT
SET CNT=CNT+1
SET HDR(CNT)=VALMHDR(LINE)
+3 IF $LENGTH($GET(VALMCAP))
SET CNT=CNT+1
SET HDR(CNT)=VALMCAP
+4 SET CNT=CNT+1
SET HDR(CNT)=""
SET $PIECE(HDR(CNT),"-",79)=""
+5 SET TOTPAGE=(LINECNT\(IOSL-CNT-2))+((LINECNT#(IOSL-CNT-2))>0)
+6 SET HDR(1)=$$SETSTR^VALM1($$FMTE^XLFDT($$NOW^XLFDT)_" Page:@@@@@@"_$S('$GET(PAGEBRK):" of "_$JUSTIFY(TOTPAGE,6),1:""),$GET(VALM("TITLE"),"NOIS"),30,51)
+7 QUIT
+8 ;
+1 NEW LINE
SET OK=1
SET PAGE=PAGE+1
+2 if '(PAGE=1&(IOST'["C-"))
WRITE @IOF
WRITE $$REPLACE^FSCRU(HDR(1),"@@@@@@",$JUSTIFY(PAGE,6))
+3 SET LINE=1
FOR
SET LINE=$ORDER(HDR(LINE))
if LINE<1
QUIT
SET CNT=CNT+1
WRITE !,HDR(LINE)
+4 IF $$S^%ZTLOAD
SET OK=0
SET ZTSTOP=1
WRITE !!,"Report has been stopped.",!
+5 QUIT