Single-Element Functions : Overview of Dataport Single Element Functions : Single-Element Function Examples : Example 1: Returning a State’s Synonym and Description

Example 1: Returning a State’s Synonym and Description

To find the synonym and the short description for a state S1 as it appears in the state’s form (the pathname CH:SSS.S1 uniquely identifies the state), include the following code in the C program:

stm_id state_id;
stm_description state_desc;
stm_short_name state_syn;
int status;

state_id = stm_r_st ("CH:SSS.S1", &status);
state_syn = stm_r_st_synonym (state_id, &status);
state_desc = stm_r_st_description (state_id, &status);

 

 

Two consecutive function calls are used to extract the synonym and the short description of the same element. The assigned variable and the function return value must have compatible data types; therefore, state_id is declared as stm_id.