AINS( ) Function

Example   See Also

Inserts an element into a one-dimensional array, or a row or column into a two-dimensional array.

Syntax

AINS(ArrayName, nElementNumber [, 2])

Returns

Numeric

Arguments

ArrayName

Specifies the name of the array into which the element is inserted.

nElementNumber

Specifies where the new element, row, or column is inserted into the array.

To insert an element into a one-dimensional array, include ArrayName and the element nElementNumber where the insertion occurs. The new element is inserted just before element nElementNumber. To insert a row into a two-dimensional array, include ArrayName and the number of the row nElementNumber where the insertion occurs. The new row is inserted just before row nElementNumber.

For more information on referencing an array element by its subscripts, see DIMENSION.

2

Inserts a column into a two-dimensional array. The new column is inserted just before the column specified with nElementNumber.

Remarks

Inserting an element, row, or column into an array does not change the size of the array. The trailing elements, rows, or columns are shifted toward the end of the array and the last element, row, or column in the array is dropped from it. The newly inserted element, row, or column is initialized to false (.F.).

AINS( ) returns 1 if the element, row, or column is successfully inserted.