Programming Guide



sm_tm_pcopy

Gets a string attribute of the current transaction and stores it

#include <tmusubs.h>
int sm_tm_pcopy(int attribute, char *attr_value, int length);

attribute
Specifies the string attribute of the current transaction to get with one of the constants shown in Table 5-18.

attr_value
A string buffer where the specified attribute's value is copied.

length
Specifies the maximum length of data to copy to attr_value, excluding the NULL string terminator. If length has a 0 or negative value, it is set to 255.

Environment

C only

Returns

Description

sm_tm_pcopy is used to obtain the current value of a string attribute of the current transaction. This includes not only data in the current transaction structure itself, but also data that can be found indirectly, such as data relating to the current table view. This function stores the value to a user-defined buffer, and returns error information.

Table 5-18 lists the constants, defined in tmusubs.h, that specify the string attributes to get with this function.

Table 5-18 Transaction string attributes

Transaction Attribute Description

TM_BUFFER

General purpose string.

TM_COMMAND_PARM

Text string passed to sm_tm_command.

TM_MSG_TEXT

Text of sm_tm_command exit message.

TM_COMMAND_ROOT

Identifies the root table view of the current command. This is either the root of the tree (for the entire transaction), or the root of the partial tree specified for the current command.

TM_PARENT_NAME

Name of parent table view of current table view.

TM_PREVIOUS_HOOK

Name of the previous event function. Used when writing an error handler.

TM_ROOT_NAME

Name of root table view of the transaction.

TM_SAVE_CURSOR

SAVE or VALIDATION cursor name.

TM_SV_NAME

Name of server view containing current table view.

TM_SV_SELECT_CURSOR

SELECT cursor name.

TM_TRAN_NAME

Name of the current transaction.

TM_TRANS_MODEL_NAME

Name of the transaction model.

TM_TV_NAME

Name of the current table view.

TM_USER_BUFFER

Buffer reserved for user use.

Data is only copied if no errors are encountered.

See Also

sm_tm_inquire, sm_tm_iset, sm_tm_pinquire, sm_tm_pset