Single-Element Functions : List of Functions : stm_r_xx_keyword

stm_r_xx_keyword
Retrieves a portion of the element’s long description. An element’s long description is attached to its form.
You can call this function without indicating the specific element type:

stm_r_keyword (id, begin_keyword, end_keyword, filename, &status)

Function Type
char *
For Elements
Syntax
stm_r_xx_keyword (xx_id, begin_keyword, end_keyword,filename, &status)
Arguments
 
Input/Output
The beginning of the portion of the string in the long description to extract
Note:  
The arguments begin_keyword and end_keyword are strings of text appearing in the element’s long description. The portion extracted from the database begins with the line following begin_keyword and extends to the line preceding end_keyword.
If the value of begin_keyword does not appear in the long description, the function creates an empty file; status then receives the value stm_starting_keyword_not_found.
If the value of end_keyword does not appear in the long description, the entire long description (from the line following the value of begin_keyword) is retrieved; status receives the value stm_ending_keyword_not_found.
The values of begin_keyword and end_keyword must appear at the beginning of a line in the long description.
filename follows the conventions of the operating system. It returns the value of the argument filename (when one is specified). If an empty string ’’ (two contiguous quotation marks) is specified for filename, Rational Statemate creates a temporary file where it stores the text. The name of this temporary file is returned by this function.
If no long description exists for the element, status receives the value stm_missing_long_description.
Status Codes
Example
The long description for the state WAIT contains the following section:

!BHV_DESCR
When the assembly process reaches the critical stage where all parts must be carefully selected, mounted and assembled, we wait for the interrupt signal to tell us that all the required parts are in place before continuing. This state acts as a synchronization point in the assembly process.
!END_DESCR

 

To extract the portion of the long description beginning with “When the ...” and ending with “... assembly process” using the following function call:

stm_id state_id;
stm_filename descr_file;
int status;
.
.
.
state_id = stm_r_st ("WAIT", &status);
descr_file = stm_r_st_keyword (state_id, "!BHV_DESCR",
"!END_DESCR", "", &status);
.
.
.

The portion of the long description is written to a file. The name of the file is returned in descr_file.