UFT Reserved Objects > DataTable Object > SetCurrentRow Method
Unified Functional Testing Automation

SetCurrentRow Method

Description

Sets the specified row as the current (active) row in the design-time or run-time data table.

Important Information

Syntax

DataTable.SetCurrentRow RowNumber

Argument

Type

Description

RowNumber
Number
Indicates the number of the row to set as the active row. The first row is numbered 1.

Example

The following example uses the SetCurrentRow method to change the active row to the second row in the global design-time or run-time data table.

DataTable.SetCurrentRow (2)

The example below performs the equivalent of renaming a column (parameter) in the DataTable by copying the data from one column to a new column with a new name, and then deleting the old column.

'add a new column
DataTable.GetSheet("Global").AddParameter "NewColumn","Row1Value"

'copy the cells from the old column into the new column
cnt=DataTable.GetRowCount
For i=1 to cnt
    DataTable.SetCurrentRow(i)
    OldVal=DataTable.Value("OldColumn","Global")
    DataTable.Value("NewColumn","Global")=OldVal
Next

'delete the old column
DataTable.GetSheet("Global").DeleteParameter("OldColumn")




© Copyright 1992 - 2017 Hewlett-Packard Enterprise Development Company, L.P.