Utility Functions : List of Utility Functions : stm_add_attribute

stm_add_attribute
Enables you to add new attributes to a properties element.
Initialization of the program must be performed in self_transaction mode; stm_init_uad with self_transaction.
Use stm_start_transaction_rw() instead of stm_start_transaction().
Use stm_commit_transaction() at the end of each transaction.
Function Type
void
For Elements
Syntax
stm_add_attribute (id, attr_name, attr_val, &status)
Arguments
Input/Output
This name must be uppercase, alpha-numeric, or empty (with a maximum length of 64).
Status Codes
Example
The following example inserts an attribute into state S1.

#include <dataport.h>

main(argc, argv)
char **argv;
int argc;
{
int status;
stm_id state_id;

if (argc!=3)
{
printf ("Usage %s PROJECT workarea\n", argv[0]);

exit (0);
}
if (!stm_init_uad(argv[1], argv[2], self_transaction,
&status))
{
printf ("can’t open workarea %s\n", argv[2]);
exit(1);
}
stm_start_transaction_rw ();
state_id = stm_r_st ("S1", &status);
stm_add_attribute (state_id, "FRED", "A Value",
&status);
stm_commit_transaction();
}