Function type:
LIST OF ELEMENT
Sorts the specified list of Statemate elements alphabetically by their synonyms.
●
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 synonyms, your template should contain the following statements:VARIABLE
LIST OF ACTIVITY act_list, ord_act_list;
MODULE act;
INTEGER status;
.
.
.
ord_act_list = stm_list_sort_by_synonym (act_list,
status);
WRITE (’\n Ordered list of activities:’);
FOR act IN ord_act_list LOOP
WRITE (’\n’, stm_r_ac_synonym (act, status), ’\t’,
stm_r_ac_name (act, status));
END LOOP;