Single-Element Functions : List of Functions : stm_r_xx_name

stm_r_xx_name
Returns the element name. For hierarchical elements, the function returns the name associated with the box. Because hierarchical elements can share the same name, the return value does not necessarily uniquely identify an element. To return a unique name, use the function stm_r_xx_uniquename.
Note the following:

This function returns a pointer to a static area of memory. Subsequent calls to this procedure will overwrite the old string. If the name needs to be preserved, use the strdup() function from the string library.

You can call this function without indicating the specific element type, as follows:

stm_r_name (id, status)

For boxes that have no names, this function returns the definition chart name. For example, for box @ABC, this function returns ABC.

Function type
STRING
For elements
Syntax
stm_r_xx_name (xx_id, status)
Arguments
Status Codes
Example
To retrieve and print the name of a state in a statechart, use the following statements:

VARIABLE
STATE state_id;
INTEGER status;
.
.
state_id := stm_r_st (’S1.S3’,status);
WRITE (stm_r_st_name (state_id, status));
.
.

In this example, the state name is provided and this value is used to retrieve the same state name from the database. The purpose of this example is to demonstrate the value returned by this function, in contrast to the value returned by the function stm_r_xx_uniquename.