IntCollection Object

Applies to TestComplete 15.46, last modified on January 09, 2023
This object is provided by the legacy OCR plugin. In version 12.60, the plugin was replaced with the new Optical Character Recognition plugin powered by Google Cloud Vision API. To learn more, see Optical Character Recognition.
The legacy OCR plugin was removed from TestComplete in version 12.60. If you need to use objects, methods, and properties provided by the legacy plugin with this version of TestComplete, please contact our Customer Care team. The legacy OCR plugin was restored in TestComplete version 14.0. To use the objects, methods, and properties with this or later TestComplete version, you need to install and enable the plugin manually.

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