Xbasic

{EXPAND}

Syntax

{EXPAND= Message }

Arguments

Message

Character. A character message to display while a tree control is being populated by a function call.

Description

The {EXPAND} command allows you to display a message to the user when the function that is populating a branch of a tree control takes a long time to respond.

Example 

This script shows how to use the {EXPAND} command in a list of values that will display in a tree control.

dim list as C
list = <<%list%
scripts|{EXPAND=Expanding folder...}!get_scripts()
functions|{EXPAND=Expanding folder...}!a5.udf_enum(2)
colors|{EXPAND=Expanding folder...}!a5.color_enum()
tables|{EXPAND=Expanding folder...}!a5.table_enum()
%list%

Each list entry follows the format: ParentNode |{EXPAND= Message }! FunctionCall. The following example shows how to structure a function that returns a list. It is very important to include the UI_YIELD() function call. The UI_YIELD()call allows Alpha Anywhere to update the user interface while the function is still executing. Without the UI_YIELD()in this function, the text in the {EXPAND} directive would not be painted onto the screen.

function get_scripts as C ()
hourglass_cursor(.t.)
ui_yield()
sleep(2)
get_scripts = a5.script_enum(2)
hourglass_cursor(.f.)
end function

Limitations

Desktop applications only.

See Also