TmListInsert Procedure
Inserts a new item into the specified list.
Usage
TmListInsert, 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—A string specifying the item to append to the list.
pos—An integer specifying the position before which to insert a new item into the list.
Keywords
None.
Discussion
The pos parameter indicates the position before which to insert the new item. The first item is 0; the second item is 1, and so on. If a new item is required at the end of the list, use TmListAppend instead of TmListInsert.
This procedure defines the behavior of the TM_LIST_INSERT method.
Example
This example creates a list and inserts items into it.
; Inserts the string 'New Item' before the first item in the list.
list_name = TmList(tool_name)
TmListAppend, tool_name, list_name, 'First Item'
TmListAppend, tool_name, list_name, 2L
TmListInsert, tool_name, list_name, 'New Item', 0
INFO, TmListRetrieve(tool_name, list_name), /Full
; Insert the float 1.1 before the third item in the list.
TmListInsert, tool_name, list_name, 1.1, 2
INFO, TmListRetrieve(tool_name, list_name), /Full
See Also