Count Property

Applies to TestComplete 12.60, last modified on September 17, 2018
The Optical Character Recognition feature provided by the OCR plugin is deprecated. It was removed from TestComplete in version 12.60 and is no longer available for later versions.
Instead, TestComplete version 12.60 introduces the new Optical Character Recognition engine featuring Google Cloud Vision API. To learn more, see Optical Character Recognition.
If you need to use the legacy feature, please contact our Customer Care team.

Description

The IntCollection.Count property returns the number of items in the integer value collection represented by the IntCollection object.

Declaration

IntCollectionObj.Count

Read-Only Property Integer
IntCollectionObj An expression, variable or parameter that specifies a reference to an IntCollection object

Applies To

The property is applied to the following object:

Property Value

An integer value that denotes the number of items in the collection of integer values.

Example

The function below obtains all the items that belong to the collection specified as the function's parameter and then posts these items to the test log.

JavaScript, JScript

function ColItems(IntCol)
{
  // Obtains the number of items in the collection
  var Num = IntCol.Count;
  
  // Iterates through the items
  for (var i = 0; i < Num; i++)
  {
    // Obtains the current item
    var Item = IntCol.Item(i);
    // Converts the item to a string and posts it to the test log
    Log.Message( IntToStr(Item) );
  }
}

Python

def ColItems(IntCol):
  # Obtains the number of items in the collection
  Num = IntCol.Count
  # Iterates through the items
  for i in range(0, Num):
    # Obtains the current item
    Item = IntCol.Item[i]
    # Converts the item to a string and posts it to the test log
    Log.Message(IntToStr(Item))

VBScript

Sub ColItems(IntCol)

  ' Obtains the number of items in the collection
  Num = IntCol.Count
  
  ' Iterates through the items
  For i = 0 to (Num - 1)
    ' Obtains the current item
    Item = IntCol.Item(i)
    ' Converts the item to a string and posts it to the test log
    Log.Message( IntToStr(Item) )
  Next
  
End Sub

DelphiScript

function ColItems(IntCol);
var Num, i, Item;
begin

  // Obtains the number of items in the collection
  Num := IntCol.Count;
  
  // Iterates through the items
  for i := 0 to (Num - 1) do
  begin
    // Obtains the current item
    Item := IntCol.Item[i];
    // Converts the item to a string and posts it to the test log
    Log.Message( IntToStr(Item) );
  end;

end;

C++Script, C#Script

function ColItems(IntCol)
{
  // Obtains the number of items in the collection
  var Num = IntCol["Count"];
  
  // Iterates through the items
  for (var i = 0; i < Num; i++)
  {
    // Obtains the current item
    var Item = IntCol["Item"](i);
    // Converts the item to a string and posts it to the test log
    Log["Message"]( IntToStr(Item) );
  }
}

See Also

IntCollection.Item
IntCollection.Add
Using Optical Character Recognition

Highlight search results