Utility Functions : List of Utility Functions : stm_str_list_next_element

stm_str_list_next_element

Function type: STRING

Description
Returns the next item in the specified list of strings.
Note that “next” refers to the item physically located after the current item in the list of strings. The “current” item is determined using the utility function stm_str_list_first_element.
Syntax
stm_str_list_next_element (list, status)
Arguments
 
Status Codes
Example
Assume we have a list of strings S1, S2, S3, and S4 assigned to the variable str_list. You locate the string S1 by calling stm_str_list_first_element. S1 becomes the current item. To find the next element in the list, use the following statements:

VARIABLE
LIST OF STRING str_list;
STRING str;
INTEGER status;
.
.
str = stm_str_list_first_element (str_list, status);
WRITE (’\n The first string in the list is: ’, str);
str := stm_str_list_next_element (str_list, status);
WRITE (’\n The second string in the list is: ’,str);
.
.

This function is often used in loop statements.