<-- Previous || Up || Next -->

Fix Up Variant Bounds Function
Fix Ups Class

Public Function FixUpVariantBounds( _
      ByRef vArray() As Variant _
    , Optional ByRef rLowerBound As Variant _
    , Optional ByRef rUpperBound As Variant _
    , Optional ByVal vDimension As Variant _
    ) As Boolean

Return True if there is at least one element in array vArray between elements rLowerBound and rUpperBound.
Assigns default values to missing rLowerBound and rUpperBound arguments using the actual bounds of the array.

Example:
    Assuming
       Dim varLower1 As Variant
       Dim varUpper1 As Variant
       Dim avarData() As Variant
       ReDim avarData(0 to 5, 0 to 20)
    for example
       FixUpVariantBounds(avarData(), varLower1, varUpper1, 1) = True
    leaves
       varLower1 = 1
       varUpper1 = 5
See also:
    ArrayArithmetic Class, et. al.
vArray: The array of Variant values whose lower and upper bounds may be examined if either rLowerBound or rUpperBound are missing.

rLowerBound: Numeric value representing the lower bound of some dimension within array vArray. rLowerBound defaults to 1 (one) if it is missing or Null or cannot be fixed-up to a number.

rUpperBound: Numeric value representing the upper bound of some dimension within array vArray. rUpperBound defaults to the upper bound of the specified dimension in vArray (UBound(vArray, vDimension)) if it is missing or Null or cannot be fixed-up to a number.

vDimension: The dimension within array vArray whose bounds are to be examined in case a default value must be supplied for rUpperBound. vDimension defaults to 1 (one) if it is missing or Null or cannot be fixed-up to a number.

Note: Function actually only determines if rLowerBound <= rUpperBound. It does not insure that rLowerBound and rUpperBound are within the bounds of the specified dimension of vArray.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.