UTILITY OBJECTS – D A T A T A B L E


 
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
UTILITY OBJECT               :           DATA TABLE
DESCRIPTION                   :           The data your test uses is stored in the design-time Data Table, which is displayed in the Data Table pane at the bottom of the screen while you insert and edit steps. The Data Table has the characteristics of a Microsoft Excel spreadsheet, meaning that you can store and use data in its cells and you can also perform mathematical formulas within the cells.
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: Value

Description:

Default Property. Retrieves or Sets value of the cell.

Syntax:

To Get the value:
DataTable.Value(ParameterID [, SheetID])
            Or
DataTable(ParameterID [, SheetID])

To Set the value:
DataTable.Value(ParameterID [, SheetID])=NewValue
Or
DataTable(ParameterID [, SheetID]) =NewValue

Argument
Type
Description
ParameterID
Variant
Identifies the parameter (column) of the value to be set/retrieved. Index values begin with 1.
SheetID
Variant
Optional. Identifies the sheet to be returned. The SheetID can be the sheet name, index or dtLocalSheet, or dtGlobalSheet.
If no Sheet is specified, the first sheet in the run-time Data Table is used (global sheet). Index values begin with 1.
NewValue
String
Sets the value for the specified table cell.

Example:

Get the Value from DataTable
1.         DataTable.Value (“Column”, Global)

Set the Value from DataTable
2.         DataTable.Value (“Column”, Global) = “Quick Test”

Delete the Un-Necessary Parameter
3.         DataTable.GetSheet("dtGlobalSheet").DeleteParameter("OldColumn")
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: AddSheet

Description:

Adds the specified sheet to the run-time Data Table.

Syntax:

DataTable.AddSheet(SheetName)

Argument
Type
Description
SheetName
String
Assigns a name to the new sheet.

Example:

DataTable.AddSheet ("MySheet")
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: DeleteSheet

Description:

Deletes the specified sheet from the run-time Data Table.

Syntax:

DataTable. DeleteSheet (SheetID)

Argument
Type
Description
SheetID
Variant
Identifies the sheet to be returned. The SheetID can be the sheet name or index. Index values begin with 1.

Example:

DataTable. DeleteSheet ("MySheet")
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: Export

Description:

Saves a copy of the run-time Data Table in the specified location.

Syntax:

DataTable.Export(FileName)

Argument
Type
Description
FileName
String
The full path of the location to which the Data Table should be exported.

Example:

DataTable.Export ("C:\FileName.xls")
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: ExportSheet

Description:

Exports a specified sheet of the run-time Data Table to the specified file.
•           If the specified file does not exist, a new file is created and the specified sheet is saved.
•           If the current file exists, but the file does not contain a sheet with the specified sheet name, the sheet is inserted as the last sheet of the file.
•           If the current file exists and the file contains the specified sheet, the exported sheet overwrites the existing sheet.

Syntax:

DataTable.ExportSheet(FileName, DTSheet)

Argument
Type
Description
FileName
String
The full path of the Excel table to which you want to export a sheet.
DTSheet
Variant
The name or index of the run-time Data Table sheet that you want to export. Index values begin with 1.

Example:

DataTable.ExportSheet "C:\FileName.xls", 1
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: Import

Description:

Imports the specified Microsoft Excel file to the run-time Data Table.

Syntax:

DataTable.Import(FileName)

Argument
Type
Description
FileName
String
The full path of the Excel table to import.

Example:

DataTable.Import ("C:\FileName.xls")
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: ImportSheet

Description:

Imports a sheet of a specified file to a specified sheet in the run-time Data Table.

Syntax:

DataTable.ImportSheet(FileName, SheetSource, SheetDest)

Argument
Type
Description
FileName
String
The full path of the Excel table from which you want to import a sheet.
SheetSource
Variant
The name or index of the sheet in the file that you want to import. Index values begin with 1.
SheetDest
Variant
The name or index of the sheet in the Data Table that you want to replace with the SheetSource. Index values begin with 1.

Example:

DataTable.ImportSheet "C:\FileName.xls", 1, "DestinationSheetName"
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: GetCurrentRow

Description:

Returns the current (active) row in the first sheet in the run-time Data Table (global sheet).

Syntax:

DataTable.ImportSheet(FileName, SheetSource, SheetDest)

Example:

intCurrentRow = DataTable.GetCurrentRow
Reporter.ReportEvent 1, "Row Number", intCurrentRow
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: GetRowCount

Description:

Returns the total number of rows in the longest column in the first sheet in the run-time Data Table (global sheet).

Syntax:

DataTable.GetRowCount

Example:

intRowCount = DataTable.GetSheet("MySheet").GetRowCount
Reporter.ReportEvent 2, "There are " &  intRowCount & "rows in the data sheet."
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: GetSheet

Description:

Returns the specified sheet from the run-time Data Table.

Syntax:

DataTable.GetSheet(SheetID)

Argument
Type
Description
SheetID
Variant
Identifies the sheet to be returned. The Sheet ID can be the sheet name or index. Index values begin with 1.

Example:

'Add a new column
DataTable.GetSheet("dtGlobalSheet").AddParameter "NewColumn", "Row1Value"
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: GetSheetCount

Description:

Returns the total number of sheets in the run-time Data Table.

Syntax:

DataTable.GetSheetCount

Example:

intSheetCountt = DataTable.GetSheetCount
Reporter.ReportEvent 0, "Sheet number", "There are " & intSheetCountt & " sheets in the Data Table."
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: GlobalSheet

Description:

Returns the first sheet in the run-time Data Table (global sheet).

Syntax:

DataTable.GlobalSheet

Example:

DataTable.GlobalSheet.AddParameter "Time", "5:45"
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: LocalSheet

Description:

Returns the current (active) local sheet of the run-time Data Table.

Syntax:

DataTable.LocalSheet

Example:

strMyParam=DataTable.LocalSheet.AddParameter ("Time", "5:45") 
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: SetCurrentRow

Description:

Sets the specified row as the current (active) row in the run-time Data Table.

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:

DataTable.SetCurrentRow (2)
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: SetNextRow

Description:

Sets the row after the current (active) row as the new current row in the run-time Data Table.

Syntax:

DataTable.SetNextRow

Example:

DataTable.SetNextRow
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: SetPrevRow

Description:

Sets the row above the current (active) row as the new current (active) row in the run-time Data Table.

Syntax:

DataTable.SetPrevRow

Example:

DataTable.SetPrevRow
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Method: RawValue

Description:

Retrieves the raw value of the cell in the specified parameter and the current row of the run-time Data Table. The raw value is the actual string written in a cell before the cell has been computed, such as the actual text from a formula.

Syntax:

DataTable.RawValue ParameterID [, SheetID]

Argument
Type
Description
ParameterID
Variant
Identifies the parameter (column) of the value to be set/retrieved. Index values begin with 1.
Note: The specified value must be an actual column header name that has been defined as a Data Table parameter. Entering A (or another default column label) as the column name is not valid unless A has explicitly been set as the name of a Data Table parameter.
SheetID
Variant
Optional. Identifies the sheet to be returned. The SheetID can be the sheet name, index or dtLocalSheet, or dtGlobalSheet.
If no Sheet is specified, the first sheet in the run-time Data Table is used (global sheet). Index values begin with 1.

Example:

FormulaVal = DataTable.RawValue ("Date", "ActionA")
‘<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

‘###################################################################################

No comments:

Post a Comment