User Tools

Site Tools


message_display_an_error_message_.htm
Navigation:  ABC Library Reference > ErrorClass > ErrorClass Methods >====== Message (display an error message) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

Message( error id, buttons, default button )

blk2blue.jpg

Message Displays an error message dialog box and returns the button the user pressed.
error id An integer constant, variable, EQUATE, or expression that indicates which ErrorClass.Errors message to show in the dialog box.
buttons An integer constant, variable, EQUATE, or expression that indicates which Windows standard buttons to place on the dialog box. This may indicate multiple buttons.
default button An integer constant, variable, EQUATE, or expression that indicates the default button on the dialog box.

The Message method displays a Windows-standard message box containing the error message text from the Errors property, and returns the number of the button the user presses to exit the dialog box. This method provides a simple, centrally maintainable, consistent way to display messages.

Implementation:

Uses the MESSAGE statement to display an application modal window with a question icon, the caption defined in the Errors property, and the message text defined in the Errors property.

The ABERROR.INC file contains a list of default symbolic constants for the error id parameter.

The EQUATES.CLW file contains symbolic constants for the buttons and default button parameters. The EQUATEs are:

BUTTON:OK

BUTTON:YES

BUTTON:NO

BUTTON:ABORT

BUTTON:RETRY

BUTTON:IGNORE

BUTTON:CANCEL

BUTTON:HELP

Return Data Type:     LONG

Example:

!attempted auto increment of key has failed,

!show Message box with Yes and No buttons, the default is No

GlobalErrors.SetErrors     !Set value of %ErrorText macro

IF GlobalErrors.Message(Msg:RetryAutoInc,BUTTON:Yes+BUTTON:No,BUTTON:No) = BUTTON:Yes

CYCLE

END

message_display_an_error_message_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1