Blitz3D+ Command Reference

CountGadgetItems ( gadget )

Parameters

gadget - combo box, list box or tabber to count the items of

Description

Returns the number of items in a combo box, list box or tabber.

Requires Extended language mode.

Items are indexed 0 to CountGadgetItems-1, so this is the loop bound whenever you sweep a list - reading every item with GadgetItemText, testing each one with GadgetItemSelected, or deleting from the end backwards so the indexes do not shift under you. The selection and context menus sample does exactly that with For index=0 To CountGadgetItems(assets)-1.

In a tabber the count is the number of tabs.

See it working in the selection and context menus sample; the world editor shell sample shows the surrounding editor pattern.

See also: AddGadgetItem, GadgetItemText, SelectedGadgetItem, CountSelectedGadgetItems, ClearGadgetItems.

Index