version 2004 (Modified)
Count list items (list{; *}) Longint
Parameter | Type | Description | |
list | ListRef | List reference number | |
* | * | If omitted (default): Return visible list items (expanded) | |
If specified: Return all list items | |||
Function result | Longint | Number of visible (expanded) list items (if * omitted) | |
or Total number of list items (if * present) |
Description
The Count list items command returns either the number of items currently "visible" or the total number of items in the list whose reference number you pass in list.
Use the * parameter to determine which type of information will be returned. When this parameter is passed, the command returns the total number of items present in the list, regardless of whether it is expanded or collapsed.
When this parameter is omitted, the command returns the number of items that are visible, depending on the current expanded/collapsed state of the list and its sublists.
You apply this command to a list displayed in a form.
Examples
Here a list named hList shown in the User environment:
$vlNbItems:=Count list items(hList) ` at this point $vlNbItems gets 8 $vlNbTItems:=Count list items(hList;*) `$vlNbTItems also gets 8
$vlNbItems:=Count list items(hList) ` at this point $vlNbItems gets 2 $vlNbTItems:=Count list items(hList;*) `$vlNbTItems still gets 8
$vlNbItems:=Count list items(hList) ` at this point $vlNbItems gets 5 $vlNbTItems:=Count list items(hList;*) `$vlNbTItems still gets 8
See Also
List item position, Selected list items.