Utility Functions : List of Utility Functions : stm_list_contains_element

stm_list_contains_element

Function type: BOOLEAN

Description
Determines whether the specified item appears in the given list.
Syntax
stm_list_contains_element (list, item, status)
Arguments
 
Input/Output
This can be a member of any element except strings. For strings, use stm_list_contains_string.
Note that the item’s data type must conform to the data type of the list. For example, if list is declared to be LIST OF STATE, item must be of type STATE (or ELEMENT).
When the list consists of Statemate elements, item contains the element’s ID.
Status Codes
Example
Suppose you want to check a list of Statemate elements for the presence of activity A1. The elements of interest are assigned to the list elmnt_list. Your template should contain the following statements:

VARIABLE
ACTIVITY act_id;
LIST OF ELEMENT elmnt_list;
INTEGER status;
.
.
.
act_id := stm_r_ac(’A1’, status);
.
.
.
IF stm_list_contains_element (elmnt_list, act_id, status) THEN
.
.
.

If A1 appears in elmnt_list, the statements following the IF statement are executed. Note that the ID of A1 is passed to the function, not its name).