XArrayDB Reference > XArrayDB Object Methods > Insert Method (XArrayDB) |
Insert Method (XArrayDB)
This method inserts a new element at position index into the dimension specified by nDim while preserving data and shifting the indexes of the existing elements appropriately.
XArrayDB.Insert nDim, index
Arguments
nDim is a one-based integer specifying an array dimension.
index is a long integer specifying an element position within the dimension nDim.
Return Value
None
Method applies to XArrayDB object.
The nDim argument should be 1 for rows and 2 for columns. A trappable error occurs if an invalid dimension is specified.
If index is greater than the value of the UpperBound property for dimension nDim, then UpperBound is adjusted to the new index.
Note: This method is provided for backward compatibility with the XArray object. Both of the following statements insert a new row at index position n.
MyArray.Insert 1, n
MyArray.InsertRows n
Similarly, both of the following statements insert a new column at index position n:
MyArray.Insert 2, n
MyArray.InsertColumns n
Unlike Insert, the InsertRows and InsertColumns methods support the insertion of multiple contiguous elements.
See Also