DeleteParameter Method
Description
Deletes the specified parameter from the sheet in the design-time or run-time data table.
Syntax
DTSheet.DeleteParameter(ParameterID)
Argument | Type | Description |
---|---|---|
ParameterID |
Variant
|
Identifies the parameter (column) to be deleted by name or index.
(Index values begin with 1.)
|
Example
The following example uses the DeleteParameter method to delete the parameter, "Arrival" from the "MySheet" sheet of the design-time or run-time data table.
DataTable.GetSheet("MySheet").DeleteParameter("Arrival")
Note that deleting a parameter from the sheet causes the run to fail if a corresponding parameter is used in a step.
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")