BBjVector::insertItem

Description

Inserts an object into the vector.

Syntax

Return Value

Method

void

insertItem(int index, Object item!)

Parameters

Variable

Description

index

This is the 0-based index at which the object will be inserted into the vector. The index must be less than or equal to the size of the vector.

item!

The object to be inserted into the vector.

Return Value

None.

Remarks

Each object in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than its previous value.

Example

rem 'Insert an item into a BBjVector object

rem 'Obtain the instance of the BBjAPI object
let myAPI! = BBjAPI()

rem 'Create an instance of the BBjVector object
let myVector! = myAPI!.makeVector()

rem 'Create values to add into the BBjVector object
A! = new java.lang.Integer(1)
A = 2
B! = new java.lang.String("Item 3")
B$ = "Item 4"

rem 'Insert the above values into the BBjVector object
myVector!.insertItem(0,A!)
myVector!.insertItem(0,A)
myVector!.insertItem(0,B!)
myVector!.insertItem(0,B$)

rem 'Get the value at the specified index, this returns the Integer 1
ITEM1! = myVector!.getItem(3)
release

See Also

BBjAPI

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.