GET 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


GET LIST ITEM (list; itemPos; itemRef; itemText{; sublist{; expanded}})

ParameterTypeDescription
listListRefList reference number
itemPosNumberPosition of item in expanded lists
itemRefNumberItem reference number
itemTextStringText of the list item
sublistListRefSublist list reference number (if any)
expandedBooleanIf a sublist is attached:
TRUE = sublist is currently expanded
FALSE = sublist is currently collapsed

Description

The command GET LIST ITEM returns information about the item whose position is passed in itemPos within the list whose reference number is passed in list.

The position must be expressed relatively, using the current expanded/collaped state of the list and its sublist. You pass a position value between 1 and the value returned by Count list items. If you pass a value outside this range, GET LIST ITEM returns your parameters unchanged.

After the call, you retrieve:

The item reference number of the item in itemRef.

The text of the item in itemText.

If you passed the optional parameters sublist and expanded:

subList returns the list reference number of the sublist attached to the item. If the item has no sublist, subList returns zero (0).

If the item has a sublist, expanded returns TRUE if the sublist is currently expanded, and FALSE if it is collapsed.

Example

hList is a list whose items have unique reference numbers. The following code programmatically toggles the expanded/collapsed state of the sublist, if any, attached to the current selected item:

   $vlItemPos:=Selected list item(hList)
   If ($vlItemPos>0)
      GET LIST ITEM(hList;$vlItemPos;$vlItemRef;$vsItemText;$hSublist;$vbExpanded)
      If (Is a list($hSublist))
         SET LIST ITEM(hList;$vlItemRef;$vsItemText;$vlItemRef;$hSublist;Not($vbExpanded))
         REDRAW LIST(hList)
      End if 
   End if 

See Also

GET LIST ITEM PROPERTIES, List item parent, List item position, Selected list item, SET LIST ITEM, SET LIST ITEM PROPERTIES.


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