Xbasic

UI_WAIT_UNTIL Function

Syntax

Result_Flag as L = UI_WAIT_UNTIL(L event[,N every[,N timeout]])

Arguments

event

An Xbasic expression that resolves to either .T. (TRUE) or .F. (FALSE).

every

Optional. Default = .001 seconds. The interval in seconds between checks of Logical_Expression.

timeout

Optional. Default = forever. The number of seconds to wait before returning to the script, regardless of Logical_Expression.

Description

The UI_WAIT_UNTIL()pauses a script until UI_MODELESS_DLG_EXIST() returns .T. (TRUE) or .F. (FALSE). Use this function when the testing if some UI component is present.

Discussion

When the Logical_Expression is .T., the function sets Result_Flag to .T.. If, after the interval specified by Timeout_After, the Logical_Expression is still not TRUE, the function sets Result_Flag to .F. (FALSE). If Timeout_After is not specified, then Alpha Five will wait indefinitely until the Logical_Expression is .T.. UI_WAIT_UNTIL Function is exactly like WAIT_UNTIL function, except it processes pending UI *before* if goes into a wait loop. This should be used when condition is ui bound (i.e. while xdialog exists).

Example 

dim code as c
code = <<%code%
ui_modeless_dlg_exist("MyModelessXdialog") = .f.
%code%
flag_result = ui_wait_until(code)
if flag_result = .t. then
       'specify code here that executes when MyModelessXdialog has closed
end if

Limitations

Desktop applications only.

See Also