IntCollection Object

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 object represents a collection of integer values. This can be a collection of colors used during character recognition in TestComplete or a collection of font sizes and a collection of font styles. To get the IntCollection object, access the FontCollection.Colors, Font.Sizes or Font.Styles property respectively.

Members

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

Optical Character Recognition
FontCollection.Colors
Font.Sizes
Font.Styles

Highlight search results