From 93dc48690767facb7e56486d396bb7e56fa4ec80 Mon Sep 17 00:00:00 2001 From: Paul Tucker Date: Sat, 27 Nov 1999 21:09:52 +0000 Subject: [PATCH] Account for correct behaviour when //noalert is specified. --- harbour/ChangeLog | 9 +++++++++ harbour/source/rtl/alert.prg | 7 ++++--- harbour/source/rtl/errorsys.prg | 18 ++++++++++-------- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a86131ff22..1f9236e191 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,12 @@ +19991127-15:57 EST Paul Tucker + * Clipper does _not_ quit if //noalert is specified and alert() is called. + * source/rtl/alert.prg + * if s_lNoAlert + RETURN NIL // Don't quit! + * updated comment in __NoNoAlert() + * source/rtl/errorsys.prg + * check for empty( nChoice ) in case alert returns nil. + 19991127-20:42 GMT+1 Victor Szel * source/rtl/dummy.prg + source/rdd/dbeval.prg diff --git a/harbour/source/rtl/alert.prg b/harbour/source/rtl/alert.prg index 8a3a65d216..e3f32aa2dd 100644 --- a/harbour/source/rtl/alert.prg +++ b/harbour/source/rtl/alert.prg @@ -158,7 +158,8 @@ FUNCTION Alert( xMessage, aOptions, cColorNorm, nDelay ) DEFAULT s_lNoAlert TO __argCheck( "NOALERT" ) IF s_lNoAlert - QUIT +// QUIT + return nil ENDIF aSay := {} @@ -410,8 +411,8 @@ FUNCTION Alert( xMessage, aOptions, cColorNorm, nDelay ) * $RETURNS$ * __NONOALERT() always return NIL. * $DESCRIPTION$ - * The //NOALERT command line switch cause the program to QUIT whenever - * it encounter ALERT() function, this function override this behavior + * The //NOALERT command line switch cause Clipper to ignore calls to + * the ALERT() function, this function override this behavior * and always display ALERT() dialog box. * $EXAMPLES$ * // make sure alert are been displayed diff --git a/harbour/source/rtl/errorsys.prg b/harbour/source/rtl/errorsys.prg index bfa73dd6eb..602658cf23 100644 --- a/harbour/source/rtl/errorsys.prg +++ b/harbour/source/rtl/errorsys.prg @@ -87,14 +87,16 @@ STATIC FUNCTION DefError( oError ) ENDDO - DO CASE - CASE aOptions[ nChoice ] == "Break" - Break( oError ) - CASE aOptions[ nChoice ] == "Retry" - RETURN .T. - CASE aOptions[ nChoice ] == "Default" - RETURN .F. - ENDCASE + IF !Empty( nChoice ) + DO CASE + CASE aOptions[ nChoice ] == "Break" + Break( oError ) + CASE aOptions[ nChoice ] == "Retry" + RETURN .T. + CASE aOptions[ nChoice ] == "Default" + RETURN .F. + ENDCASE + ENDIF // "Quit" selected