Utility Functions : List of Utility Functions : stm_str_list_last_element

stm_str_list_last_element

Function type: STRING

Description
Returns the element ID of the last item appearing in the specified list of strings.
Note the following:

The first position in the string is 0.

If the function fails, it returns an empty string.

Syntax
stm_str_list_last_element (list, status)
Arguments
 
Status Codes
Example
Assume there is a list of strings (S1, S2, S3, and S4) assigned to the variable str_list. You locate the string S4 by calling stm_str_list_last_element. S4 becomes the “current” item. Your template should contain the following statements:

VARIABLE
LIST OF STRING str_list;
STRING str;
INTEGER status;
.
.
str := stm_str_list_last_element (str_list, status);
WRITE (’\n The last string in the list is: ’, str);
str := stm_str_list_previous_element (str_list, status);
WRITE (’\n The third string in the list is: ’, str);
.
.