ISStates.Count

Description

The number of the states for the country within the collection.

Syntax

object.Count

Part Attribute Type Description
object Required
The object always implements the ISStates interface
Restriction: This property is readonly.

Return Value

int

Example

Display the number of the states of the countries, their descriptions, codes and IDs.

Dim aCountryItems, aCountryItem
Dim aMessage
Dim aStatesList
Dim aState
Dim i, j

set aCountryItems = Profile.LoadCountryList
aMessage = "Country Items Count: " & aCountryItems.Count 

for i = 0 to aCountryItems.Count - 1 
  set aCountryItem = aCountryItems.Item(i)
  set aStatesList = aCountryItem.GetStatesList 
  
  aMessage = aMessage & vbNewLine & (i+1) & ") " & aCountryItem.LongName 

  if not aStatesList is nothing then
    aMessage = aMessage & vbNewLine & "  States (Count = " & aStatesList.Count & "):"
    for j = 0 to aStatesList.Count - 1
      set aState = aCountryItem.GetStatesList.Item (j)
      aMessage = aMessage & vbNewLine & "  -" & aState.Description &_
        " (Code: " & aState.Code & "; ID: " & aState.ID & ") "            
    next
  end if
next  
 
Profile.MsgBox(aMessage)
Note:

Version information

Added in v7.8.0