PRCFYN ;WISC@ALTOONA/CTB-UTILITY YES/NO READER AND WAIT ;10 Sep 89 3:08 PM [11/13/98 4:19pm]
V ;;5.1;IFCAP;;Oct 20, 2000
;Per VHA Directive 10-93-142, this routine should not be modified.
YN ;
K DTOUT S U="^" S:'$D(%)#2 %=3 S %S=% I %=3 S %=""
I '$D(%A(0)) S %A(0)=""
W:%A(0)["!" ! W:$D(%A)#2 !,%A
F %I=0:0 S %I=$O(%A(%I)) Q:'%I Q:'$D(%A(%I)) W !,%A(%I)
W:%A(0)["*" $C(7)
W "? ",$P("YES// ^NO// ^<YES/NO> ",U,%S)
RX R %Y:$S($D(DTIME):DTIME,1:300) E S DTOUT=1,%Y=U W $C(7)
S:%Y]""!'% %=$A(%Y),%=$S(%=89:1,%=121:1,%=78:2,%=110:2,%=94:-1,1:0)
I '%,%Y'["?" G Q1
W:$X>73 ! W $P(" (YES)^ (NO)",U,%)
G:%'=0 Q I $D(%B),%B]"" W !!,%B D C G:'$D(%A) Q S %=%S G YN
I $D(%B),%B="" G Q1
I $D(%A),'$D(%B) S %=%S G YN
Q K %Y,%A,%B,%S,%I Q
Q1 W:'%&(%Y'["?") $C(7) W !,"You must enter a 'Yes' or a 'No', or you may enter an '^' to Quit",! S %=%S G YN
Q
C F %I=0:0 S %I=$O(%B(%I)) Q:'%I Q:'$D(%B(%I)) W !,%B(%I)
W ! Q
WAIT ;
W !,"..."
W $P("Whoops,^Hmmm,^Excuse me,^Sorry,^Alright already!^OK! OK!^Alright, I'm tired.","^",$R(7)+1)," "
W $P($T(LIST+$R(8)),";",3)_"..."
LIST ;;This may take a few moments
;;Let me put you on 'HOLD' for a second
;;Please hold on
;;Just a moment, please
;;I'm working as fast as I can
;;Let me think about this for a moment
;;I'm just having one of those days...
;;Is it lunchtime yet?...
;
; ** VARIABLE DEFINITIONS **
; Inputs
; % = default response as 1=Yes 2=No 3=Yes/No
; %A = Prompt Text array (optional)
; %B = Help text array (optional)
; Output
; % as 1=Yes 2=No -1=abort (^) 0=none of the above
;
; NOTES
; If %A(0) contains "!", a linefeed precedes the prompt(s)
; If %A(0) contains "*", the bell sounds after the prompt(s)
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCFYN 1768 printed Oct 16, 2024@18:05:21 Page 2
PRCFYN ;WISC@ALTOONA/CTB-UTILITY YES/NO READER AND WAIT ;10 Sep 89 3:08 PM [11/13/98 4:19pm]
V ;;5.1;IFCAP;;Oct 20, 2000
+1 ;Per VHA Directive 10-93-142, this routine should not be modified.
YN ;
+1 KILL DTOUT
SET U="^"
if '$DATA(%)#2
SET %=3
SET %S=%
IF %=3
SET %=""
+2 IF '$DATA(%A(0))
SET %A(0)=""
+3 if %A(0)["!"
WRITE !
if $DATA(%A)#2
WRITE !,%A
+4 FOR %I=0:0
SET %I=$ORDER(%A(%I))
if '%I
QUIT
if '$DATA(%A(%I))
QUIT
WRITE !,%A(%I)
+5 if %A(0)["*"
WRITE $CHAR(7)
+6 WRITE "? ",$PIECE("YES// ^NO// ^<YES/NO> ",U,%S)
RX READ %Y:$SELECT($DATA(DTIME):DTIME,1:300)
IF '$TEST
SET DTOUT=1
SET %Y=U
WRITE $CHAR(7)
+1 if %Y]""!'%
SET %=$ASCII(%Y)
SET %=$SELECT(%=89:1,%=121:1,%=78:2,%=110:2,%=94:-1,1:0)
+2 IF '%
IF %Y'["?"
GOTO Q1
+3 if $X>73
WRITE !
WRITE $PIECE(" (YES)^ (NO)",U,%)
+4 if %'=0
GOTO Q
IF $DATA(%B)
IF %B]""
WRITE !!,%B
DO C
if '$DATA(%A)
GOTO Q
SET %=%S
GOTO YN
+5 IF $DATA(%B)
IF %B=""
GOTO Q1
+6 IF $DATA(%A)
IF '$DATA(%B)
SET %=%S
GOTO YN
Q KILL %Y,%A,%B,%S,%I
QUIT
Q1 if '%&(%Y'["?")
WRITE $CHAR(7)
WRITE !,"You must enter a 'Yes' or a 'No', or you may enter an '^' to Quit",!
SET %=%S
GOTO YN
+1 QUIT
C FOR %I=0:0
SET %I=$ORDER(%B(%I))
if '%I
QUIT
if '$DATA(%B(%I))
QUIT
WRITE !,%B(%I)
+1 WRITE !
QUIT
WAIT ;
+1 WRITE !,"..."
+2 WRITE $PIECE("Whoops,^Hmmm,^Excuse me,^Sorry,^Alright already!^OK! OK!^Alright, I'm tired.","^",$RANDOM(7)+1)," "
+3 WRITE $PIECE($TEXT(LIST+$RANDOM(8)),";",3)_"..."
LIST ;;This may take a few moments
+1 ;;Let me put you on 'HOLD' for a second
+2 ;;Please hold on
+3 ;;Just a moment, please
+4 ;;I'm working as fast as I can
+5 ;;Let me think about this for a moment
+6 ;;I'm just having one of those days...
+7 ;;Is it lunchtime yet?...
+8 ;
+9 ; ** VARIABLE DEFINITIONS **
+10 ; Inputs
+11 ; % = default response as 1=Yes 2=No 3=Yes/No
+12 ; %A = Prompt Text array (optional)
+13 ; %B = Help text array (optional)
+14 ; Output
+15 ; % as 1=Yes 2=No -1=abort (^) 0=none of the above
+16 ;
+17 ; NOTES
+18 ; If %A(0) contains "!", a linefeed precedes the prompt(s)
+19 ; If %A(0) contains "*", the bell sounds after the prompt(s)