Count list items

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

version 2004 (Modified)


Count list items (list{; *}) Longint

ParameterTypeDescription
listListRefList reference number
**If omitted (default): Return visible list items (expanded)
If specified: Return all list items
Function resultLongintNumber 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.


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