RemoveCol - method of the PmaDataTable object
Removes one column on the specified position. Existing columns after this position are moved. All rows of the table are removed as well !
Long RemoveCol(Variant Col)
|Col||(Variant) If the value of this parameter is the number >=0, then it is the column index (zero-based index) that has to be removed.
The -2 value means that the column has to be removed from the end of the table.
If the value of the parameter is of the String type, then it is the name of the column that has to be removed.
Returns the index of the removed column. It returns the negative number if an error occurred (the column has not been removed). Then the error is written into the INFO system
Column of data type Identifier
cannot be removed (if present). Only the following columns can be removed.
"Read only" columns:
If at least one cell is locked in "Read only" column by writing non-empty value, then the whole structure of the table is locked. Then it is no longer possible to add or remove rows or columns or change the structure of the table. The structure and dimensions of the table must be defined and modified before writing first non-empty value into a cell in "Read only" column.
In the /DataTable
object (of the PmaDataTable
type) the following operations proceeds:
- The forth column is removed (the column on the index 3)
- The last column is removed
- The column named "abc" is removed
oDataTable = pMe.Pm("/DataTable");