Skip to content

dos_msgboxchk

Dale Fugier edited this page Jul 1, 2026 · 1 revision

Displays a message box that gives the user the option of suppressing further occurrences. If the user has already opted to suppress the message box, the function does not display a dialog box and instead simply returns the default value.

Note Do not confuse "Do not show this dialog box" with "Remember this answer". This function does not provide "Remember this answer" functionality. If the user opts to suppress the message box again, the function does not preserve which button they clicked. Instead, subsequent invocations of this function simply return a developer-provided default value.

Syntax

(dos_msgboxchk text title button icon default regkey)

Parameters

text

The message to be displayed.

title

The message box title.

button

The push button format. The allowable values are as follows:

Value Description
0 Abort, Retry and Ignore
1 OK
2 OK and Cancel
3 Retry and Cancel
4 Yes and No
5 Yes, No and Cancel

icon

The icon. The allowable values are as follows:

Value Description
0 Asterisk
1 Exclamation
2 Hand
3 Information
4 Question
5 Stop

default

The value that the function returns when the user has opted not to have the message box displayed again. If the user has not opted to suppress the message box, the message box is displayed and the function ignores default. Note, default values must be either less than -1 or greater than 6.

regkey

A unique string value to associate with this message box.

Returns

An integer indicating one of the following buttons was pressed:

Value Description
0 Abort
1 Cancel
2 Ignore
3 No
4 OK
5 Retry
6 Yes

If the user has not opted to suppress the message box, the default value is returned.

nil if not successful or on error.

Example

Command: (dos_msgboxchk "Are you sure?" "Save" 4 3 -2 "MyMsgBox")
6

Clone this wiki locally