Item Property

Applies to TestComplete 14.71, last modified on April 22, 2021

Description

The TableVariable object corresponds to a project, project suite or keyword test variable of the Table type. Use the Item property to obtain or specify the value of an array’s element with the specified index.

Declaration

TableVariableObj.Item(ColumnRowIndex)

Read-Write Property Variant
TableVariableObj An expression, variable or parameter that specifies a reference to a TableVariable object
Column [in]    Required    Variant    
RowIndex [in]    Required    Integer    

Applies To

The property is applied to the following object:

Parameters

The property has the following parameters:

Column

Specifies the index or name of the column that contains the desired element. Column indexes are zero-based.

RowIndex

Specifies the row that contains the desired element.

Property Value

A Variant value stored in the array’s element.

Example

The following example demonstrates how you can use the Item property to modify the values of the desired Table variables.

JavaScript

let s;
    s = "John";
    Project.Variables.MyVar.$set("Item", 0, 0, s);
// -- or --
    Project.Variables.VariableByName("MyVar").$set("CustomerName", 0, s);

JScript

var s;
    s = "John";
    Project.Variables.MyVar.Item(0, 0) = s;
// -- or --
    Project.Variables.VariableByName("MyVar").CustomerName(0) = s;

Python

s = "John"
Project.Variables.MyVar.Item[0, 0] = s
# -- or --
Project.Variables.VariableByName["MyVar"].CustomerName[0] = s

VBScript

s = "John"
Project.Variables.MyVar.Item(0, 0) = s
' -- or --
Project.Variables.VariableByName("MyVar").CustomerName(0) = s

DelphiScript

var
  s : OleVariant;
begin
      s := 'John';
      Project.Variables.MyVar.Item(0, 0) := s;
  // -- or --
      Project.Variables.VariableByName('MyVar').CustomerName(0) := s;
end;

C++Script, C#Script

var s;
    s = "John";
    Project["Variables"]["MyVar"].Item(0, 0) = s;
// -- or --
    Project["Variables"]["VariableByName"]("MyVar").CustomerName(0) = s;

See Also

ColumnCount Property
RowCount Property
Iterator Property
Variables of the Table Type

Highlight search results