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

Sort Order Matching Characters Function
Sort Orders Class

Public Function SortOrderMatchingCharacters( _
      Optional ByVal vCompare As Variant _
    , Optional ByVal vIsMax As Variant _
    ) As String

Creates a 256-character string containing either the minimum or maximum Asc(ii) value of each of the characters that have the same collating sequence.

Examples:
    SortOrderMatchingCharacters(vbTextCompare, False)   = "...ABC...ABC..." ' #1
    SortOrderMatchingCharacters(vbTextCompare, True)    = "...abc...abc..." ' #2
    SortOrderMatchingCharacters(vbBinaryCompare, False) = "...ABC...abc..."
    SortOrderMatchingCharacters(vbBinaryCompare, True)  = "...ABC...abc..."
Note: The results of each example function has been condensed with "..." to save space.
See also:
    SortOrderMatchingCharacterPairs Function
    SortOrderString Function
Note: Function currently only works for characters whose ASCII value is between 0 and 255, so it does NOT support UNICODE.

vCompare: Specifies the sort order/collating sequence which is to be examined. Function finds either the minimum or maximum character which matches every character. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.

vIsMax: Determines whether this function returns the maximum matching character or the minimum matching character. Set to True to return the maximum match, or False to return the minimum match. vIsMax defaults to False (the minimum matching characters will be returned) if it is missing or Null or cannot be fixed up to a number.
Note: Set vIsMax to False to determine the upper-case equivalent of each character as in example #1, or set it to True to determine the lower-case equivalent of each character as in example #2.

Note: Characters are reviewed in sorted order, but the result string is constructed from the Asc(ii) of the characters being reviewed. When reviewing characters in sorted order, if adjacent characters have the same collating sequence, use the first character encountered with the same collating sequence.

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