Share this page

# ctrx_wait_for_event

Example | Citrix Synchronization Functions

Waits for a specified event to occur.

`int ctrx_wait_for_event( char *event, [CONTINUE_ON_ERROR,] CTRX_LAST );`

event | The name of the event to wait for. One of: LOGON_AND_AGENT LOGON
CONTINUE_ON_ERROR | A constant, entered as shown without quotes. Overrides the error behavior runtime setting for this step so that script behaves as though the runtime setting was Continue on error.
CTRX_LAST | A marker that indicates the end of the argument list.

ctrx_wait_for_event is a synchronization function that waits for an event to occur.

Session initialization and CitrixAgent initialization may take longer than LOGON. As a result, ctrx* functions that follow immediately after ctrx_wait_for_event(LOGON) may fail. To ensure that the agent is running before continuing to the next step, use ctrx_wait_for_event(LOGON_AND_AGENT).

## Return Values

Citrix ICA Return Values

## Parameterization

Standard parameterization is not available for this function.

## Example

In the following example, the function ctrx_wait_event waits for the connection to be established to the server ludens.

    Actions () {

         ctrx_connect_server("ludens", "test", "test", "ludens", CTRX_LAST);
         ctrx_wait_for_event("LOGON");

         /* Launch the web browser by clicking on desktop IE icon*/
         ctrx_mouse_double_click(34, 325, LEFT_BUTTON, 0, NULL, CTRX_LAST);
         lr_think_time(13);
         ctrx_set_window("Welcome to MSN.com - Microsoft Internet Explorer", CTRX_LAST);

         /* Exit the web browser by clicking on top left Exit check box */
         ctrx_mouse_click(573, 61, LEFT_BUTTON, 0,
                   "Welcome to MSN.com - Microsoft Internet Explorer", CTRX_LAST);
         lr_think_time(13);
         ctrx_disconnect_server("ludens", CTRX_LAST);

         return 0;
    }

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: