Link Search Menu Expand Document

Object.Insert Method

Explanation Add an element to the arrayed object.

This method is attached only to array objects and array elements. This method has no effect on non-arrayed objects.

Running on an array object inserts a new element at the end of the array.
When executed on an array element, a new element is inserted at the previous position.
Call format obj.Insert( [ count ] )
obj[ index ].Insert( [ count ] )
Return value None
Arguments integer count Specifies the number of elements to insert. If omitted, one item will be inserted.
integer index Specify the insertion position with a subscript. The element at the specified position must exist.
Exception None
Example of use
/* Usage example for array objects */
Record arrayRec[] {
    Number numItem;
    String strItem;
}
arrayRec.Insert(10);
 
/* Usage example for array elements */
Record arrayRec[5] {
    Number numItem;
    String strItem;
}
arrayRec[1].Insert(2);
 
 
Related item Truncate method