INSERT LIST ITEM

4D - Documentation   Français   English   German   4th Dimension 2003, Command Theme List   4th Dimension 2003, Command Alphabetical List   4th Dimension 2003, Constant Theme List   Back   Previous   Next

version 6.0


INSERT LIST ITEM (list; beforeItemRef | *; itemText; itemRef{; sublist{; expanded}})

ParameterTypeDescription
listListRefList reference number
beforeItemRef | *Number | *Item reference number or
* for current selected list item
itemTextStringText for the new list item (max. 31 characters)
itemRefNumberUnique reference number for the new list item
sublistListRefOptional sublist to attach to the new list item
expandedBooleanIndicates 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

APPEND TO LIST.


4D - Documentation   Français   English   German   4th Dimension 2003, Command Theme List   4th Dimension 2003, Command Alphabetical List   4th Dimension 2003, Constant Theme List   Back   Previous   Next