SELECT LIST ITEM BY REFERENCE

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


SELECT LIST ITEM BY REFERENCE (list; itemRef)

ParameterTypeDescription
listListRefList reference number
itemRefNumberItem reference number

Description

The command SELECT LIST ITEM BY REFERENCE selects the item whose item reference number is passed in itemRef within the list whose reference number is passed in list.

If there is no item with the item reference number you passed, the command does nothing.

If the item is not currently visible (i.e., it is located in a collapsed sublist), the command expands the required sublist(s) so that the new selected item becomes visible.

If you work with item reference numbers, builds a list in which the items have unique reference numbers, otherwise you will not be able to distinguish the items. For more information, see the description of the command APPEND TO LIST.

Example

hList is a list whose items have unique reference numbers. The following object method for a button selects the parent item (if any) of the current selected item:

   $vlItemPos:=Selected list item(hList)   ` Get position of selected item
   GET LIST ITEM(hList;$vlItemPos;$vlItemRef;$vsItemText) ` Get item ref. num. of selected item
   $vlParentItemRef:=List item parent(hList;$vlItemRef)  ` Get item ref. num. of parent item (if any)
   If ($vlParentItemRef>0)
        SELECT LIST ITEM BY REFERENCE(hList;List item parent(hList;$vlItemRef)) ` Select the parent item
        REDRAW LIST(hList)  ` Do NOT forget to call REDRAW LIST otherwise the list won't be updated
   End if 

See Also

SELECT LIST ITEM, Selected 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