Single-Element Functions : Calling Single-Element Functions : Examples of Single-Element Function Calls : Single-Element Function Example 3

Single-Element Function Example 3

The following example shows how to include a portion of the long description of the state S1 in a document. The section extracted is the text appearing between the strings ’!BEGIN’ and ’!END’.

VARIABLE
STATE state_id;
STRING descr_file;
.
.
state_id := stm_r_st (’S1’, status);
descr_file := stm_r_st_keyword (state_id, ’!BEGIN’,
’!END’,’’,status);
INCLUDE (descr_file);
.
.
.

The fourth input parameter (the empty string) of the function stm_r_st_keyword determines the name of the file to which the extracted text is written. If the string is empty, as in this case, the Documentor creates a temporary file where it stores the text. The name of this temporary file is returned by the function. Using the INCLUDE statement, you write the text to the generated document.