wait_for_state(_c)
detected.i4.v = wait_for_state_c(state_device.i4.v, state_value.i4.v,
condition.i4.v, timeout.i4.v,
top_row.i4.v, left_column.i4.v)
This routine waits for the occurrence of a state event. It will wait
until the timeout period has elapsed or the user interrupts. If
"row" and "column" are specified, an informational window will be
displayed. (Note: This routine calls abort_check. So, if the
call to this routine is preceded by a call to abort_init,
the user can abort out of the waiting for event loop.)
state_device state device index
state_value state value to look for
condition condition to wait for
(DATA_EVENT_STATE_EQUALS -> wait for matching state,
DATA_EVENT_STATE_NOT_EQUALS -> wait for nonmatching
state,
DATA_EVENT_STATE_ALL -> wait for any state assertion,
DATA_EVENT_STATE_LESS_THAN -> wait for state value
which is less than the
requested value,
DATA_EVENT_STATE_LESS_EQUAL -> wait for state value
which is less than or
equal to the requested
value,
DATA_EVENT_STATE_GREATER_THAN -> wait for state value
which is greater than
the requested value,
DATA_EVENT_STATE_GREATER_EQUAL -> wait for state value
which is greater than
or equal to the
requested value)
timeout seconds before timeout, if <= 0 wait indefinitely
top_row top row of message window
(use WMNGR_CENTER for centering)
(Passing a value of 0 results in no message window.)
left_column left column of message window
(use WMNGR_CENTER for centering)
(Passing a value of 0 results in no message window.)
This function returns status values as follows:
CBS_WINDOW_TOO_BIG window won't fit on screen
CBS_INVARG invalid state condition passed
CBS_MEMFAIL dynamic memory allocation failure
TRUE state event was detected
FALSE state event was not detected
This function requires the following include files:
cnsparam_h, cns_data_structs_h, cbslib_h, state_values_h, acnet_errors_h
Related functions:
waitev(_c), wait_for_predicted_event_c, abort_check, abort_init
C/C++ usage:
int status;
int state_device = V_VOID;
int state_value = 1;
int condition = DATA_EVENT_STATE_NOT_EQUALS;
int timeout = 0;
int top_row = WMNGR_CENTER;
int left_column = WMNGR_CENTER;
status = wait_for_state_c(state_device,state_value,condition,
timeout,top_row,left_column);