InsertItem method: Collection class

Syntax

InsertItem(&Elem, index)

Description

Use this method to insert an element at the specified location in the collection. The item must be instantiated first by using the CreateItem method.

Parameters

Parameter Description

&Elem

Specifies the element to be inserted as an object: a Collection object, a Compound object, or a Primitive object.

index

Specifies the sequence number for the element to be inserted as an integer.

Returns

A Boolean value : True if the insertion was completed successfully, False otherwise.

Example

For example, for a collection with four items (a, b, c, d), the following call to insert item f would result in a collection with five items (a, f, b, c, d):

&ret = &Coll.InsertItem(&f, 2);