TmSetAttribute Function
Set an attribute for an item in the given VDA Tool.
Usage
value = TmSetAttribute(tool_name, item, attr_name, attr_value)
Parameters
tool_name—A string containing the unique name of a VDA Tool.
item—The name of an item associated with the VDA Tool.
attr_name—A string specifying an attribute to set for the given item.
attr_value—A value to set for the given attribute.
Returned Value
value—Returns the previously set attribute value. If no attribute value was previously set, the function returns an empty string.
Keywords
None.
Discussion
TmSetAttribute is used to register attributes and their values with the Tools Manager. The Tools Manager stores information about every item added to a VDA Tool instance in its data structure. This information includes the VDA Tool’s unique name and items that have been assigned to the VDA Tool, such as graphical elements and variables. Each item added to a VDA Tool can have a set of characteristics that the VDA Tool programmer defines. These characteristics are called attributes, and attributes can be assigned values.
Example
Assume that an instance of a VDA Tool is currently running, and that the variable var was passed to the VDA Tool (possibly when the VDA Tool was called). The following code retrieves the name of the variable that was passed to the VDA Tool and registers that variable with the Tools Manager. Then, several attributes are set for the variable for that instance of the VDA Tool. When the VDA Tool displays the data in the variable, the plot will reflect these set attributes (e.g., line color, linestyle, plot symbol type, and symbol color).
; From within the VDA Tool program level, obtain the name of the
; variable var on the $MAIN$ program level.
INFO, var, upvar=main_name
; Register the variable to the Tools Manager.
TmAddVar, unique, main_name
; Set attributes with which to display the variable: color, 
; linestyle, plot symbol, and symbol color.
tmp = TmSetAttribute(unique, main_name, 'COLOR', 6)
tmp = TmSetAttribute(unique, main_name, 'LSTYLE',8)
tmp = TmSetAttribute(unique, main_name, 'PSYM',  10)
tmp = TmSetAttribute(unique, main_name, 'PSYM_COLOR', 12)
See Also