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

Str Comp Custom Function
Comparisons Class

Public Function StrCompCustom( _
      ByVal vStringOne As Variant _
    , ByVal vStringTwo As Variant _
    , Optional ByVal vSortOrder As Variant _
    ) As Variant

"String Compare Custom"
Like the Visual Basic StrComp function, except that it uses a custom sort order/collating sequence.
Compare two string values to determine if one is less than, equal to, or greater than the other.

Examples:
    StrCompCustom("S", "T", EveryCharacter) = -1
    StrCompCustom("S", "s", EveryCharacter) = -1
    StrCompCustom("s", "S", EveryCharacter) = 1
See also:
    SortOrders Class
    CharacterTypes Class
    CharacterArrays Class
    EveryCharacter Property
    StrComp Function (Visual Basic)
vStringOne: First of two string values which are to be compared to determine if it is less than, equal to, or greater than the other. Function returns Null if vStringOne is Null or cannot be fixed up to a String.

vStringTwo: Seconds of two string values which are to be compared to determine if it is less than, equal to, or greater than the other. Function returns Null if vStringTwo is Null or cannot be fixed up to a String.

vSortOrder: String whose characters define the custom sort order/collating sequence that will be used to compare the two strings vStringOne and vStringTwo. vSortOrder defaults to the value of the EveryCharacter function if it is missing or Null or cannot be fixed up to a String; with vSortOrder set to that string, it will perform Binary comparisons and would be the same as calling the StrComp function with an Compare argument of vbBinaryCompare. The Asc(ii) values in the SortOrder string represent the collating sequence of the character at that position + 1. For example, the Asc(ii) value of Left$(vSortOrder, 1) represents the collating sequence of Chr$(0), Asc(Mid$(vSortOrder, 2, 1)) represents the collating sequence of Chr$(1), etc.

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