ORRU ; SLC/JER - Scroll-mode Utility Subroutines ; 5-APR-2002 12:39:51
;;3.0;ORDER ENTRY/RESULTS REPORTING;**174**;Dec 17, 1997
STOP(PROMPT,SCROLL) ; Call DIR at bottom of screen
N DIR,X,Y
I $E(IOST)'="C" S Y="" G STOPX
I +$G(SCROLL),(IOSL>($Y+5)) F W ! Q:IOSL<($Y+6)
S DIR(0)="FO^1:1"
S DIR("A")=$S($G(PROMPT)]"":PROMPT,1:"Press RETURN to continue or '^' to exit")
S DIR("?")="Enter '^' to quit present action or '^^' to quit to menu"
D ^DIR I $D(DIRUT),(Y="") K DIRUT
S Y=$S(Y="^":0,Y="^^":0,$D(DTOUT):"",Y="":1,1:1_U_Y)
STOPX Q Y
READ(TYPE,PROMPT,DEFAULT,HELP,SCREEN) ; Calls reader, returns response
N DIR,X,Y
S DIR(0)=TYPE
I $D(SCREEN) S DIR("S")=SCREEN
I $G(PROMPT)]"" S DIR("A")=PROMPT
I $G(DEFAULT)]"" S DIR("B")=DEFAULT
I $D(HELP) S DIR("?")=HELP
D ^DIR
I $G(X)="@" S Y="@" G READX
I Y]"",($L($G(Y),U)'=2) S Y=Y_U_$G(Y(0),Y)
READX Q Y
LISTREAD(ORLIST,ANSTYPE) ; Present list to user for selection of item(s)
N ORI,ORL,ORY S (ORI,ORY)=0
S ANSTYPE=$S($G(ANSTYPE)]"":$G(ANSTYPE),1:"N")
F S ORI=$O(ORLIST(ORI)) Q:+ORI'>0 D
. W !,ORI,?5,$P(ORLIST(ORI),U,2) S ORL=ORI
I +$G(ORL) D
. W !
. S ORY=$$READ(ANSTYPE_"A^1:"_ORL,"Select "_$P(ORLIST,U)_": ")
. I +ORY S ORY=$G(ORLIST(+ORY))
Q ORY
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORRU 1254 printed Dec 13, 2024@02:34:03 Page 2
ORRU ; SLC/JER - Scroll-mode Utility Subroutines ; 5-APR-2002 12:39:51
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**174**;Dec 17, 1997
STOP(PROMPT,SCROLL) ; Call DIR at bottom of screen
+1 NEW DIR,X,Y
+2 IF $EXTRACT(IOST)'="C"
SET Y=""
GOTO STOPX
+3 IF +$GET(SCROLL)
IF (IOSL>($Y+5))
FOR
WRITE !
if IOSL<($Y+6)
QUIT
+4 SET DIR(0)="FO^1:1"
+5 SET DIR("A")=$SELECT($GET(PROMPT)]"":PROMPT,1:"Press RETURN to continue or '^' to exit")
+6 SET DIR("?")="Enter '^' to quit present action or '^^' to quit to menu"
+7 DO ^DIR
IF $DATA(DIRUT)
IF (Y="")
KILL DIRUT
+8 SET Y=$SELECT(Y="^":0,Y="^^":0,$DATA(DTOUT):"",Y="":1,1:1_U_Y)
STOPX QUIT Y
READ(TYPE,PROMPT,DEFAULT,HELP,SCREEN) ; Calls reader, returns response
+1 NEW DIR,X,Y
+2 SET DIR(0)=TYPE
+3 IF $DATA(SCREEN)
SET DIR("S")=SCREEN
+4 IF $GET(PROMPT)]""
SET DIR("A")=PROMPT
+5 IF $GET(DEFAULT)]""
SET DIR("B")=DEFAULT
+6 IF $DATA(HELP)
SET DIR("?")=HELP
+7 DO ^DIR
+8 IF $GET(X)="@"
SET Y="@"
GOTO READX
+9 IF Y]""
IF ($LENGTH($GET(Y),U)'=2)
SET Y=Y_U_$GET(Y(0),Y)
READX QUIT Y
LISTREAD(ORLIST,ANSTYPE) ; Present list to user for selection of item(s)
+1 NEW ORI,ORL,ORY
SET (ORI,ORY)=0
+2 SET ANSTYPE=$SELECT($GET(ANSTYPE)]"":$GET(ANSTYPE),1:"N")
+3 FOR
SET ORI=$ORDER(ORLIST(ORI))
if +ORI'>0
QUIT
Begin DoDot:1
+4 WRITE !,ORI,?5,$PIECE(ORLIST(ORI),U,2)
SET ORL=ORI
End DoDot:1
+5 IF +$GET(ORL)
Begin DoDot:1
+6 WRITE !
+7 SET ORY=$$READ(ANSTYPE_"A^1:"_ORL,"Select "_$PIECE(ORLIST,U)_": ")
+8 IF +ORY
SET ORY=$GET(ORLIST(+ORY))
End DoDot:1
+9 QUIT ORY