GetItemCount Function (ComboBox ListBox ListView Menu PopupList RadioList)

Class

  • ComboBox
  • ListBox
  • ListView
  • Menu
  • PopupList
  • RadioList

Action

Returns the number of items in the list, list box, listview, menu, popup list, radio list, or combo box list box.

Availability

For the ListView class, this method is supported only in scripts that use the Classic Agent.

Syntax

iCount = list.GetItemCount()
Variable Description
iCount The number of items in the object. INTEGER.

Notes

  • With the Classic Agent, GetItemCount returns the number of items in the menu or list, not including separators.
  • With the Open Agent, GetItemCount returns the number of items in the menu or list, including separators.
  • The GetItemCount method is not available in the ListViewEx class, which is the equivalent of the ListView class on the Open Agent. To achieve the same functionality for a listview with the Open Agent, use the ItemCount property of the ListViewEx class.

Example

INTEGER iNumberOfItems
iNumberOfItems = TextEditor.File.GetItemCount()