version 6.0
INSERT LIST ITEM (list; beforeItemRef | *; itemText; itemRef{; sublist{; expanded}})
| Parameter | Type | Description | |
| list | ListRef | List reference number | |
| beforeItemRef | * | Number | * | Item reference number or | |
| * for current selected list item | |||
| itemText | String | Text for the new list item (max. 31 characters) | |
| itemRef | Number | Unique reference number for the new list item | |
| sublist | ListRef | Optional sublist to attach to the new list item | |
| expanded | Boolean | Indicates if the sublist will be expanded or collapsed |
Description
The INSERT LIST ITEM command inserts a new item in the list whose reference number you pass in list.
If you pass * as second parameter, the item is inserted before the current selected item in the list. In this case, the newly inserted item will also become the selected item.
Otherwise, if you want to insert an item before a specific item, you pass the item reference number of that item. In this case, the newly inserted item is not automatically selected. If there is no item with that item reference number, the command does nothing.
You pass the text and the item reference number of the new item in itemText and itemRef.
Note: Even if they both are optional, the sublist and expanded parameters must be passed jointly.
Example
The following code inserts an item (with no attached sublist) just before the item currently selected in the list hList:
vlUniqueRef:=vlUniqueRef+1 INSERT LIST ITEM(hList;*;"New Item";vlUniqueRef) REDRAW LIST(hList)
See Also