Utility Functions : List of Utility Functions : stm_list_length

stm_list_length

Function type: INTEGER

Description
Returns the length of the specified list.
Syntax
stm_list_length (list, status)
Arguments
 
LIST OF ELEMENT
Items in the input list can ve of any element type except string. For strings, see to stm_str_list_length.

 

Status Codes
Example
Assume you extracted all the events from the database whose name begins with EV. Before writing the list to your document, you want to make sure that it will not span more than 30 lines of text (one page length). Your template should contain the following statements:

VARIABLE
EVENT ev;
LIST OF EVENT ev_list;
INTEGER ev_list_len, status;
CONSTANT
INTEGER page_len := 30;
.
.
.
ev_list:-stm_re_ev_name_of_ev (’EV*’, status);
ev_list_len := stm_list_length (ev_list, status);
IF ev_list_len < page_len
WRITE (’\n List of Events: ’);
FOR ev IN ev_list LOOP
WRITE (’\n’, stm_ev_name (ev, status));
END LOOP;
END IF

The list is written to the document if there are less than 30 events whose name begins with “EV”.