Message_Box function

Displays a Windows message in event context

button = message_box (ownerwindow, text, title, options)

The Message_Box function has the following parameters:

ParameterDescription
ownerwindowThe window ID of the window to use as a parent. This parameter can be null to use the screen as a parent. Typically, this parameter is @window. For MDI children, pass the frame ID.
textPass the message text. Multiple lines are delimited by CR/LF. CR/LF can be coded as \0D0A\ or char(13):char(10). The constant MSG_NL$ is defined in the insert record Message_Box_Equates and can be used to separate multiple lines of text.
titlePass the title for the message.
optionsThe options are defined in the insert record Message_Box_Equates under the sections "button arrangement", "default button", and "message icon". To specify multiple options, add the options together. For example:

MSG_BTN_YES_NO_CAN$ + MSG_DEFAULT2$ + MSG_ICON_QUESTION$

The return values from Message_Box are defined in the insert record Message_Box_Equates. Each button (ok, cancel, yes, no, abort, retry, ignore) returns a different value.

Yes/No/Cancel, Default to 'No' Button

declare function Message_Box

$insert Message_Box_Equates

retval = Message_Box( @window ,'Yes/No/Cancel, default to No',

         'Please Confirm', MSG_BTN_YESNOCAN$ + MSG_DEFAULT2$)

if retval = MSG_RET_YES$ then

    *  user clicked "YES', so do processing, then display message

    retval = Message_Box (@window, 'Processing completed!', 'Done!', MSG_BTN_OK$)

end

Message with Information Icon

$insert Message_Box_Equates
Message_Box(@window, "Connection opened!", "Data Download", MSG_ICON_INFO$)
  • guides/programming/programmers_reference_manual/message_box.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1