Function MsgBox() Foundation

Displays a message in a graphic dialog window.

MsgBox( <cMessage>, [<cTitle>] ) --> NIL
<cMessage> is a character string containing the text displayed in the message box. Carriage return (Chr(13)) and line feed (Chr(10)) act as the new line characters. The text following the carriage return or line feed is displayed on the next line. In order to insert a blank line, two subsequent carriage return or line feed characters must be inserted into the text.
<cTitle> is a character string which is displayed in the title line of the message box. The default value is a null string ("").

The return value of MsgBox() is always NIL.


The function MsgBox() displays text in a simple, graphic dialog window. A single "Ok" pushbutton is displayed under the text and is used to close the window.

The dialog window's size is determined by the operating system and can not be defined explicitly. If a very long text is to be displayed, this should be done using Xbase Parts (like XbpStatic or XbpMLE). Otherwise, parts of the text or the "Ok" pushbutton may be displayed outside the visible screen area.

MsgBox() displays a simple dialog window which does not forward any messages to the Xbase++ application. This means that neither a call back method nor a call back code block is executed as long as this window has focus. In general this is only significant when a code block is assigned to the :paint call back slot or when the :paint()method of an Xbase Part is overloaded.

When a program calls this function it must be linked with /PM:PM. The function cannot be used in text mode applications.

Display a message in a GUI application
// In the example, a message box is displayed containing 
// three lines of message text. The second line is a 
// blank line. 


   MsgBox( "The program" + Chr(13) + Chr(10) + ; 
           "has now ended!", ; 
           "Program end" ) 


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.