Logo
Home Cart [Log In] About Us Contact Us

Object Reference

xf_StringCaseInsensitiveString Functions

Public Function CompareValue (
field1 As Variant,
field2 As Variant,
Optional SortDirectionAsc As Boolean = True
) As Integer

Compare two possibly Null valued variables.
Returns 0 if equal, 1 if field1 is greater than field2, and -1 if field1 is less than field2 Null is always less than any non-Null value

field1 as Variant

The first variable

field2 as Variant

The second variable

Optional SortDirectionAsc as Boolean = True

if False, reverse the compare result

Call Template:

Dim i As Integer
i = xf.Str.CompareValue(field1, field2)
i = xf.Str.CompareValue(field1, field2, SortDirectionAsc)

See Also:

Example 1:

1
2
3
4
5
CompareValue(Null, Null)   => 0
CompareValue(Null, 1)      => -1
CompareValue(1, Null)      => 1
CompareValue(3, 3)         => 0
CompareValue(2, 10)        => -1
Contact Us :: About Us :: Policies :: email: infspamo@arrospamw-of-tispamme.com    © 2012 Arrow Of Time Pty Ltd