Values Property

Applies to TestComplete 14.10, last modified on June 5, 2019

Description

Use the Values property to obtain or specify values stored in the DBTable project element that corresponds to the DBTableObj object.

Note: The DBTable object provides access to a copy of the stored data. So, changes made to stored values via the Values property only effect it during the test execution. The changes will not be applied to data stored in the DBTable project element and will not be displayed in the editor.

Declaration

DBTableObjObj.Values(aRowaColumn)

Read-Write Property String
DBTableObjObj An expression, variable or parameter that specifies a reference to a DBTableObj object
aRow [in]    Required    Integer    
aColumn [in]    Required    Integer    

Applies To

The property is applied to the following object:

Parameters

The property has the following parameters:

aRow

The row index of the desired value. This index coincides with the row position in the DBTable Element editor. The index is zero-based, that is, TestComplete considers that the first row has the index of 0, the second row has the index of 1 and so on.

The total number of stored rows is specified by the RowCount property of the DBTable object.

aColumn

The column index of the desired value. This index coincides with the column position in the DBTable Element editor. The index is zero-based, that is, TestComplete considers that the first column has an index of 0, the second column has an index of 1 and so on.

To obtain the index of a column by the column name, use the ColumnIndex property of the DBTable object.

Property Value

Value of the specified stored cell.

Remarks

If you use Python or DelphiScript, you should enclose the parameters of the Values property in square brackets: Values[aRow, aColumn].

Example

The code below demonstrates how you can modify DBTable elements by using the Values property.

JavaScript

function DBTableValues()
{
  // Specifies the stored DBTable element
  let DBTab = DBTables.DBTable1;
  
  // Modifies the table elements
  DBTab.$set("Values", 0, 0, "Text for the first cell.");
  DBTab.$set("Values", 2, 1, 128.4);
  //...
}

JScript

function DBTableValues()
{
  // Specifies the stored DBTable element
  var DBTab = DBTables.DBTable1;
  
  // Modifies the table elements
  DBTab.Values(0, 0) = "Text for the first cell.";
  DBTab.Values(2, 1) = 128.4;
  //...
}

Python

def DBTableValues():
  # Specifies the stored DBTable element
  DBTab = DBTables.DBTable1
  # Modifies the table elements
  DBTab.Values[0, 0] = "Text for the first cell."
  DBTab.Values[2, 1] = 128.4
  # ...

VBScript

Sub DBTableValues

  ' Specifies the stored DBTable element
  Set DBTab = DBTables.DBTable1
  
  ' Modifies the table elements
  DBTab.Values(0, 0) = "Text for the first cell."
  DBTab.Values(2, 1) = 128.4
  '...
   
End Sub

DelphiScript

function DBTableValues();
var DBTab;
begin

  // Specifies the stored DBTable element
  DBTab := DBTables.DBTable1;
  
  // Modifies the table elements
  DBTab.Values[0, 0] := 'Text for the first cell.';
  DBTab.Values[2, 1] := 128.4;
  //...

end;

C++Script, C#Script

function DBTableValues()
{
  // Specifies the stored DBTable element
  var DBTab = DBTables["DBTable1"];
  
  // Modifies the table elements
  DBTab["Values"](0, 0) = "Text for the first cell.";
  DBTab["Values"](2, 1) = 128.4;
  //...
}

See Also

About Database Checkpoints
Modifying DBTable Elements
ValuesSelected Property
ColumnIndex Property
RowCount Property

Highlight search results