Single-Element Functions : Overview of Dataport Single Element Functions : Single-Element Function Examples : Example 3: Writing a Portion of the Long Description

Example 3: Writing a Portion of the Long Description

To output the portion of a long description appearing between the strings "!BEGIN" and "!END" for state S1, use the following code:

stm_id state_id;
stm_filename descr_file;
.
.
.
state_id = stm_r_st ("S1", &status);
descr_file = stm_r_st_keyword (state_id,
"!BEGIN", "!END", "", &status);
.
.
.

The fourth input parameter (empty string) of the function stm_r_st_keyword determines the file name to which the extracted text is written. If the string is empty, as it is in this case, the function creates a temporary file. The name of this file is returned by the function (in this case, the assignment statement stores the returned file name in descr_file).