contents   index   previous   next



Obtaining Information about a Safe Array

 

f90VB SafeArray Library includes several functions and subroutines that facilitate acquiring information about an allocated Safe Array. This section briefly describes some of them and gives a few examples of how to use them.

 

Two basic functions and one subroutine can be used to obtain information about the dimensions and the data type contained in a Safe Array; SafeArrayGetDim, SafeArrayGetElementSize and SafeArrayGetVarType. SafeArrayGetDim returns the number of dimensions of a Safe Array. SafeArrayGetElementSize returns the size in bytes of the elements contained in a Safe Array. SafeArrayGetVarType is a subroutine that with a return argument that contains the VT-Type of the elements of an array if the array was allocated with a VT-Type (i.e. using SafeArrayCreate).

 

To obtain information about the bounds and size of the dimensions of an array, your Fortran application can call subroutines SafeArrayGetLBound and SafeArrayGetUBound. You can also call SafeArrayGetNElements to find out the size of a dimension of the Safe Array. Example 2.4 illustrates how to use several of these procedures.