SafeArrayGetUBound
(SafeArrayUpperBound)
f90VB Modules
f90VBDefs, f90VBSafeArrays
Summary
Returns the upper bound of a dimension in a Safe Array.
SafeArrayGetUBound is a subroutine. It returns the upper bound of a dimension in argument Bound. SafeArrayUpperBound is a function whose return value is the upper bound of the passed Safe Array dimension. Function SafeArrayUpperBound is usually more convenient to use when setting limits to the iterator of a DO loop.
Syntax
Syntax Variation 1:
| integer(LONG_KIND) function SafeArrayUpperBound | (SARef, nDim, iRet) |
| { | |
| integer(SAFEARRAY_KIND),intent(in):: | SARef | |
| type(FSafeArray),intent(in):: | SARef | |
| } | |
| integer(LONG_KIND),intent(in):: | nDim |
| integer(HRESULT_KIND),intent(out),optional:: | iRet |
| subroutine SafeArrayGetUBound | (SARef, nDim, LBound, iRet) |
| { | |
| integer(SAFEARRAY_KIND),intent(in):: | SARef | |
| type(FSafeArray),intent(in):: | SARef | |
| } | |
| integer(LONG_KIND),intent(in):: | nDim |
| integer(LONG_KIND),intent(out):: | Bound |
| integer(HRESULT_KIND),intent(out),optional:: | iRet |
Arguments
SARef [Input]
A handle to, or a Fortran Safe Array structure containing a handle to, an allocated Safe Array descriptor.
nDim [Input]
The array dimension for which to get the upper bound.
Bound [Output]
Variable where the upper bound is returned. If you are using Syntax Variation 1, the upper bound is returned as the result of function SafeArrayUpperBound.
iRet [Output, Optional]
Upon return, iRet contains S_OK or an error code. See comments for more information.
Comments
Note that SARef must be a reference to an allocated Safe Array descriptor.
If an error condition occurs, the return value of function SafeArrayUpperBound is an error code, as described in iRet.
Argument iRet
Indicates success or failure of the subroutine. The following codes can be returned in this argument:
| Value returned in argument iRet | Description | |
| S_OK | Success. | |
| DISP_E_BADINDEX | The specified dimension is out of bounds. | |
| E_INVALIDARG | The item pointed to by SARef is not a Safe Array descriptor | |
Examples
See example for SafeArrayGetDim.
Related Topics
| For information about | See | |
| Creating a Safe Array | SafeArrayCreate | |
| Obtaining the lower bound of an array dimension | SafeArrayGetLBound | |
| Obtaining the number of elements in an array dimension | SafeArrayGetNElements | |
| Setting the bounds of an array dimension | SafeArraySetBounds | |
| Allocating a Safe Array descriptor | SafeArrayAllocDescriptor | |