Function type:
LIST OF ELEMENT
Sorts the specified list of Statemate elements alphabetically by name.
●
The function returns the status code
stm_elements_without_name
when you attempt to apply this function to a list that contains unnamed elements.
●
The function receives and returns a list of element IDs, not a list of element names.
The list of Statemate elements to be sorted. This input lists consists of element IDs. Suppose you want to write a particular list of activities from the database to your document. You extract the activities of interest using single-element and query functions and build a list of such activities. This list is assigned to the variableact_list
. To alphabetically sort the activities by their names, your template should contain the following statements:VARIABLE
LIST OF ACTIVITY act_list, ord_act_list;
ACTIVITY activ;
INTEGER status;
.
.
ord_act_list := stm_list_sort_by_name (act_list, status);
WRITE (’\n Ordered list of activities:’);
FOR activ IN ord_act_list LOOP
WRITE (’\n’, stm_r_ac_name (activ, status));
END LOOP;