KMPDUG2 ;OAK/RAK - CM Tools Graph Utility ;2/17/04 09:59
;;3.0;KMPD;;Jan 22, 2009;Build 42
;
OPTIONS(KMPUOPTS) ;-- select options.
;-----------------------------------------------------------------------
; KMPUOPTS.. Result of selection.
; Exceptions: "" - No options selected.
; ^ - User up-arrowed out.
;-----------------------------------------------------------------------
N I,X,OUT
S KMPUOPTS="",OUT=0
S DTIME=$S($G(DTIME):DTIME,1:300)
F D Q:OUT
.W !?5,"The following graph selections are 'optional':"
.D DISPLAY(.KMPUOPTS) I KMPUOPTS="" S OUT=1 Q
.R !!,"Enter one or more option letter(s): ",X:DTIME
.I X="" S OUT=1,KMPUOPTS="" Q
.I X="^" S OUT=1,KMPUOPTS="^" Q
.I X["?" D HELP W @IOF Q
.;
.; remove any commas, dashes or spaces.
.S X=$TR(X,",- ",""),X=$$UP^XLFSTR(X)
.;
.; check for invalid answer.
.D CHECK Q:KMPUOPTS=""
.;
.I X["A",(X'["V") D Q
..W *7,!!?10,"Angle Data Titles only available with a Vertical Graph..."
.;
.; if vertical display warning message.
.I X["V" D
..W !!?7,"...please be aware that because of screen limitations Vertical"
..W !?7," Graphs are not as accurate as Horizontal Graphs and should be"
..W !?7," used for visual comparison rather than detailed analysis..."
.;
.S KMPUOPTS=X,OUT=1
;
Q
;
CHECK ;-- check for valid answer.
N I
F I=1:1:$L(X) I KMPUOPTS'[$E(X,I) D Q
.W *7,!!?10,"'",$E(X,I),"' is not an available option."
.S KMPUOPTS=""
Q
;
DISPLAY(KMPUOPT) ;-- display available options.
;-----------------------------------------------------------------------
; KMPUOPT... Will be set to available options.
;-----------------------------------------------------------------------
N I S KMPUOPT="" W !
F I=1:1 Q:$T(OPT+I)']"" D
.W !?7,$P($T(OPT+I),";",3)," - ",$P($T(OPT+I),";",4)
.S KMPUOPT=KMPUOPT_$P($T(OPT+I),";",3)
Q
;
FTR(FOOTER,VALUE) ;print footer
;--------------------------------------------------------------------
; line feed to IOSL-3 and place message on screen
; if IOSL or IOM are not defined routine will quit
;
; FOOTER - text to appear at the bottom of the screen
; if footer is not defined then the message
; 'Press RETURN to continue, '^' to exit' will appear
;
; footer appears in the middle of the screen
;
; VALUE - value returned:
; "" - if IOSL or IOM are not defined
; 0 - if an uparrow '^' is entered
; 1 - if return is entered
;
S VALUE=""
I '$G(IOSL)!('$G(IOM)) Q
N DIR,I,X,Y
I $G(FOOTER)']"" S FOOTER="Press RETURN to continue, '^' to exit"
I $G(IORVON)']""!($G(IORVOFF)']"") N IORVON,IORVOFF,X D
.S X="IORVON;IORVOFF" D ENDR^%ZISS
S FOOTER=IORVON_" "_FOOTER_" "_IORVOFF
S DIR(0)="EA",DIR("A")=$J(" ",(IOM-$L(FOOTER)/2))_FOOTER
F I=$Y:1:(IOSL-3) W !
D ^DIR S VALUE=Y
Q
;
HELP ;--help display for options.
N KMPUOUT
W @IOF
W !,"A: Angle data titles..: Angle the titles (for Vertical Graphs only)."
W !," Example: __________"
W !," | |"
W !," | |"
W !," | |"
W !," __________"
W !," J F M A"
W !," a e a p"
W !," n b r r"
W !
W !,"D: Double space data..: Will place an empty column/row between graph bars"
W !," (it is highly recommended that double spacing be used"
W !," with Vertical graphs)."
W !
W !,"G: Grid...............: Print grid lines on graph."
W !," example: ______________________________"
W !," Jan | | | | | | |"
W !," Feb | | | | | | |"
W !," Mar | | | | | | |"
W !," Apr | | | | | | |"
W !," ______________________________"
D FTR("",.KMPUOUT) Q:'KMPUOUT W @IOF
W !,"S: Scientific Notation: If values are 1000 or greater the graph will normally"
W !," display a description as...: (x10k), (x100k), etc."
W !," - Scientific notation will be: (x10^2), (x10^3), etc."
W !
W !,"V: Vertical graph.....: The default is horizontal display."
W !," - Selecting this option will display data vertically"
W !," (graph bars running top to bottom)."
D FTR("Press <RET> to continue: ") W @IOF,!!!
Q
;
OPT ;list of options
;;A;Angle data titles (vertical graph only).
;;D;Double space data.
;;G;Grid.
;;S;Scientific Notation.
;;V;Vertical graph.
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPDUG2 4832 printed Dec 13, 2024@01:41:07 Page 2
KMPDUG2 ;OAK/RAK - CM Tools Graph Utility ;2/17/04 09:59
+1 ;;3.0;KMPD;;Jan 22, 2009;Build 42
+2 ;
OPTIONS(KMPUOPTS) ;-- select options.
+1 ;-----------------------------------------------------------------------
+2 ; KMPUOPTS.. Result of selection.
+3 ; Exceptions: "" - No options selected.
+4 ; ^ - User up-arrowed out.
+5 ;-----------------------------------------------------------------------
+6 NEW I,X,OUT
+7 SET KMPUOPTS=""
SET OUT=0
+8 SET DTIME=$SELECT($GET(DTIME):DTIME,1:300)
+9 FOR
Begin DoDot:1
+10 WRITE !?5,"The following graph selections are 'optional':"
+11 DO DISPLAY(.KMPUOPTS)
IF KMPUOPTS=""
SET OUT=1
QUIT
+12 READ !!,"Enter one or more option letter(s): ",X:DTIME
+13 IF X=""
SET OUT=1
SET KMPUOPTS=""
QUIT
+14 IF X="^"
SET OUT=1
SET KMPUOPTS="^"
QUIT
+15 IF X["?"
DO HELP
WRITE @IOF
QUIT
+16 ;
+17 ; remove any commas, dashes or spaces.
+18 SET X=$TRANSLATE(X,",- ","")
SET X=$$UP^XLFSTR(X)
+19 ;
+20 ; check for invalid answer.
+21 DO CHECK
if KMPUOPTS=""
QUIT
+22 ;
+23 IF X["A"
IF (X'["V")
Begin DoDot:2
+24 WRITE *7,!!?10,"Angle Data Titles only available with a Vertical Graph..."
End DoDot:2
QUIT
+25 ;
+26 ; if vertical display warning message.
+27 IF X["V"
Begin DoDot:2
+28 WRITE !!?7,"...please be aware that because of screen limitations Vertical"
+29 WRITE !?7," Graphs are not as accurate as Horizontal Graphs and should be"
+30 WRITE !?7," used for visual comparison rather than detailed analysis..."
End DoDot:2
+31 ;
+32 SET KMPUOPTS=X
SET OUT=1
End DoDot:1
if OUT
QUIT
+33 ;
+34 QUIT
+35 ;
CHECK ;-- check for valid answer.
+1 NEW I
+2 FOR I=1:1:$LENGTH(X)
IF KMPUOPTS'[$EXTRACT(X,I)
Begin DoDot:1
+3 WRITE *7,!!?10,"'",$EXTRACT(X,I),"' is not an available option."
+4 SET KMPUOPTS=""
End DoDot:1
QUIT
+5 QUIT
+6 ;
DISPLAY(KMPUOPT) ;-- display available options.
+1 ;-----------------------------------------------------------------------
+2 ; KMPUOPT... Will be set to available options.
+3 ;-----------------------------------------------------------------------
+4 NEW I
SET KMPUOPT=""
WRITE !
+5 FOR I=1:1
if $TEXT(OPT+I)']""
QUIT
Begin DoDot:1
+6 WRITE !?7,$PIECE($TEXT(OPT+I),";",3)," - ",$PIECE($TEXT(OPT+I),";",4)
+7 SET KMPUOPT=KMPUOPT_$PIECE($TEXT(OPT+I),";",3)
End DoDot:1
+8 QUIT
+9 ;
FTR(FOOTER,VALUE) ;print footer
+1 ;--------------------------------------------------------------------
+2 ; line feed to IOSL-3 and place message on screen
+3 ; if IOSL or IOM are not defined routine will quit
+4 ;
+5 ; FOOTER - text to appear at the bottom of the screen
+6 ; if footer is not defined then the message
+7 ; 'Press RETURN to continue, '^' to exit' will appear
+8 ;
+9 ; footer appears in the middle of the screen
+10 ;
+11 ; VALUE - value returned:
+12 ; "" - if IOSL or IOM are not defined
+13 ; 0 - if an uparrow '^' is entered
+14 ; 1 - if return is entered
+15 ;
+16 SET VALUE=""
+17 IF '$GET(IOSL)!('$GET(IOM))
QUIT
+18 NEW DIR,I,X,Y
+19 IF $GET(FOOTER)']""
SET FOOTER="Press RETURN to continue, '^' to exit"
+20 IF $GET(IORVON)']""!($GET(IORVOFF)']"")
NEW IORVON,IORVOFF,X
Begin DoDot:1
+21 SET X="IORVON;IORVOFF"
DO ENDR^%ZISS
End DoDot:1
+22 SET FOOTER=IORVON_" "_FOOTER_" "_IORVOFF
+23 SET DIR(0)="EA"
SET DIR("A")=$JUSTIFY(" ",(IOM-$LENGTH(FOOTER)/2))_FOOTER
+24 FOR I=$Y:1:(IOSL-3)
WRITE !
+25 DO ^DIR
SET VALUE=Y
+26 QUIT
+27 ;
HELP ;--help display for options.
+1 NEW KMPUOUT
+2 WRITE @IOF
+3 WRITE !,"A: Angle data titles..: Angle the titles (for Vertical Graphs only)."
+4 WRITE !," Example: __________"
+5 WRITE !," | |"
+6 WRITE !," | |"
+7 WRITE !," | |"
+8 WRITE !," __________"
+9 WRITE !," J F M A"
+10 WRITE !," a e a p"
+11 WRITE !," n b r r"
+12 WRITE !
+13 WRITE !,"D: Double space data..: Will place an empty column/row between graph bars"
+14 WRITE !," (it is highly recommended that double spacing be used"
+15 WRITE !," with Vertical graphs)."
+16 WRITE !
+17 WRITE !,"G: Grid...............: Print grid lines on graph."
+18 WRITE !," example: ______________________________"
+19 WRITE !," Jan | | | | | | |"
+20 WRITE !," Feb | | | | | | |"
+21 WRITE !," Mar | | | | | | |"
+22 WRITE !," Apr | | | | | | |"
+23 WRITE !," ______________________________"
+24 DO FTR("",.KMPUOUT)
if 'KMPUOUT
QUIT
WRITE @IOF
+25 WRITE !,"S: Scientific Notation: If values are 1000 or greater the graph will normally"
+26 WRITE !," display a description as...: (x10k), (x100k), etc."
+27 WRITE !," - Scientific notation will be: (x10^2), (x10^3), etc."
+28 WRITE !
+29 WRITE !,"V: Vertical graph.....: The default is horizontal display."
+30 WRITE !," - Selecting this option will display data vertically"
+31 WRITE !," (graph bars running top to bottom)."
+32 DO FTR("Press <RET> to continue: ")
WRITE @IOF,!!!
+33 QUIT
+34 ;
OPT ;list of options
+1 ;;A;Angle data titles (vertical graph only).
+2 ;;D;Double space data.
+3 ;;G;Grid.
+4 ;;S;Scientific Notation.
+5 ;;V;Vertical graph.