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

Fix Up Variant Compare Sub
Fix Ups Class

Public Sub FixUpVariantCompare( _
    ByRef rCompare As Variant _
    )

Fix up the Compare argument required by many functions.
The Compare argument specifies the string comparison type and/or sort order/collating sequence for the function.

Summary: Numeric values are converted to Long data type values. Other non-numeric values replaced with vbBinaryCompare.
rCompare: A Variant whose value is assumed to represent one of the string comparison types or collating sequences. If rCompare is numeric or a numeric string, it is converted to an Long. rCompare is assigned to the value of the Application Class Compare Property in the following circumstances: 1) if rCompare is Null, 2) if rCompare cannot be fixed up to a number, or 3) if rCompare was missing within the function that called this one.
Note: The following subroutine calls are equivalent:
    FixUpVariantCompare vCompare
    FixUpVariantToLongMandSub vCompare, vbBinaryCompare
Note: This function will always modify its rCompare argument (unless it generates a runtime error because the argument was a number not within the range allowed for Long values).
Example:
    Assuming
       Dim varTemp As Variant
       varTemp = vbTextCompare
    for example
       FixUpVariantCompare varTemp
    leaves
       varTemp = vbTextCompare
Example:
    Assuming
       Dim varTemp As Variant
       varTemp = Null
    for example
       FixUpVariantCompare varTemp
    leaves
       varTemp = vbBinaryCompare
v1.3 Change: This subroutine no longer uses the value of the Application Class Compare Property. It now sets the argument to vbBinaryCompare when the argument is not a valid Long number.

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