UI_DLG_BOX()

Syntax

Result as C = UI_DLG_BOX( Title as C, Format_String as C [, Event_String as C ] )

Argument

Description

Result

The value returned by the dialog. This is typically the name of the BUTTON that was pressed to close the dialog.

Title

The title of the dialog. The title may also be specified dynamically using the syntax:

Title = "@=" + Title_Var_Name.

Format_String

A series of Xdialog commands that describe the appearance of the dialog box. The basic structure of the Format section is:

<<%dlg% Ã
Xdialog_Code
Ã
%dlg%
 

Argument

Description

<<%dlg%

The only optional part of this argument is the "dlg" sequence of characters (the marker), which can be any string of characters, as long as it is unique within this instance of the UI_DLG_BOX() function. The character sequence <<%dlg% is specifically recommended because it is supported by bubble help.

Xdialog_Code

One or more statements, each of which must be on a separate line from the <<%dlg% and %dlg% arguments.

%dlg%

The marker characters can be any string of characters, as long as they match those in the first argument (<<%dlg%).

Event_String

Optional. Xbasic code that describes what should happen when various events happen when the user is interacting with the dialog box. For example, what should happen when the user presses a button, or when the user tabs out of a field. The basic structure of the Event Handling section is:

<<%code% Ã
Xbasic_Code
Ã
%code%

Description

The UI_DLG_BOX() function displays a modal dialog box and returns a character string. The UI_MODELESS_DLG_BOX() function displays a modeless dialog box.

Supported By

Alpha Five Version 5 and Above

Limitations

Desktop applications only.

Example

This example of an extremely simple dialog box with the text "Hello World."

ui_dlg_box("Title","Hello World")

Alternatively:

format = <<%dlg%

"Hello World"

%dlg%

ui_dlg_box("Title", format)

Here is what this dialog box looks like: [Picture]

Here is a dialog box with a title defined after the dialog box is displayed. The "@" is the indirection operator.

dim dlg_title as C

 

dlg_title = "Title1"

ui_dlg_box("@=dlg_title",<<%dlg%

<Set Title!settitle>

%dlg%,<<%code%

if a_dlg_button = "settitle" then

    dlg_title = ui_get_text("","Set new title",dlg_title)

     a_dlg_button = ""

end if

%code%)

See Also

Xdialogs Are Built from Strings, Xdialog Function Reference, Xdialog Control Reference