TmListReplace Procedure
Replaces an item in a list with a new item.
Usage
TmListReplace, tool_name, list_name, item, pos
Input Parameters
tool_name—A string specifying the unique name of a VDA Tool.
list_name—A string specifying the unique name of a list.
item—The new item to add to the list. This parameter may be any PV‑WAVE variable.
pos—An integer specifying the position of the item to replace.
Keywords
None.
Discussion
The pos parameter indicates the position of the item to replace. The first item is 0; the second item is 1, and so on. If the position specified falls beyond the end of the list, the item will be appended to the list.
This procedure defines the behavior of the TM_LIST_REPLACE method.
Example
This example replaces the third item in the list with the string 'New Item'.
list_name = TmList(tool_name)
TmListAppend, tool_name, list_name, 'First Item'
TmListAppend, tool_name, list_name, 2L
TmListAppend, tool_name, list_name, 3.3
INFO, TmListRetrieve(tool_name, list_name), /Full
TmListReplace, tool_name, list_name, 'New Item', 2
INFO, TmListRetrieve(tool_name, list_name), /Full
See Also