add item

Examples


The add item statement adds an item to a list field: a list box, multi-select list box, combo box, drop-down list, button drop list or visual switch. This statement also allows you to associate a numeric value with each item added to the list.

Syntax

add item string_expression {, value} to {field} window_field

Parameters

string_expression – The string you want to add to the list field.

value – An optional parameter containing the long integer to add to the list field in conjunction with the string_expression. If this parameter isn’t used, 0 will be associated with the string_expression.

field – An optional keyword identifying window_field as a field.

window_field – A list field displayed in the window.

Comments

The add item statement adds the contents of the string_expression to a list field. The new item is added to the end of the list of items to be displayed. Items and their associated values are added at runtime, and aren’t saved in the application dictionary. If items are added while the field is displayed, the field must be redrawn before the added string will appear.

 

The numeric values related to the added items won’t appear in the list. However, they can be retrieved using the itemdata() function, and then used in scripts.


Documentation Feedback