Collection.Count

From Xojo Documentation
Jump to: navigation, search
Method

Collection.Count() As integer

The number of elements in the collection. Returns an integer. Each element is a Value, Key pair.

Example

The folllowing example displays the value of Count in a TextField.

Dim c As New Collection
c.Add(1, "ID")
c.Add("Lois Lane", "Name")
c.Add("Reporter", "JobTitle")
c.Add(85000, "Salary")
c.Add(lois, "Picture") // lois is a Picture added to the project
TextField1.Text = c.Item("ID")
TextField2.Text = c.Item(2) // returns "Lois Lane"
TextField3.Text = c.Item("JobTitle")
TextField4.Text = c.Item("Salary")
Canvas1.Backdrop = c.Item("Picture")

TextField5.Text = Str(c.Count)
Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About