System.VarUtils.SafeArrayRedim

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function SafeArrayRedim(VarArray: PVarArray; const NewBound: TVarArrayBound): HRESULT;
function SafeArrayRedim(VarArray: PVarArray; NewBound: PVarArrayBound): HRESULT; external oleaut name 'SafeArrayRedim';

Properties

Type Visibility Source Unit Parent
function public System.VarUtils.pas System.VarUtils System.VarUtils

Description

Changes the bound information for the last dimension of a safe array.

SafeArrayRedim resizes the safe array given through the VarArray parameter, by changing the bound information for the last dimension of the array, according to the NewBound parameter. VarArray is a pointer to the safe array.

The possible return values of SafeArrayRedim are listed in the following table, together with their meaning.



Value Meaning

VAR_OK

The operation was completed successfully.

VAR_INVALIDARG

The given argument is nil.

VAR_ARRAYISLOCKED

The array given through VarArray is locked.

VAR_EXCEPTION

The application raised an exception.

VAR_OUTOFMEMORY

There is not enough memory to complete the operation.



After the resizing operation took place, the existing elements of the array are preserved and the new elements are set to zero or empty.

Note: A safe array cannot be resized while it is locked.

See Also