Signature (Visual Basic / VBA)
Public Function SortOrderString( _
Optional ByVal vCompare As Variant _
) As String
Code Example
SortOrderString(vbBinaryCompare) = Chr$(0) + Chr$(1) + ... + Chr$(255) ' #1
SortOrderString(vbBinaryCompare) = EveryCharacter
Parameters
| Parameter | Description |
|---|---|
| vCompare | Specifies the sort order/collating sequence for which the sort order string will be prepared. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number; in the Binary collating sequence, the result matches the string produced by the EveryCharacter function. |
Notes & Version History
| Details | Within the result string, the character position identifies the character whose collating sequence is described. The ASCII value of the characters identifies the position of the character within the collating sequence. The Sequence of the character with ASCII value X in the collating sequence is Asc(Mid$(Result, X + 1, 1)) where Result is the string returned by this function. For example, the sequence of "A" within the sort order is Asc(Mid$(Result, 66, 1)). |
| Note | The results of example #1 has been condensed with "..." to save space. |
| Note | Function currently only works for characters whose ASCII value is between 0 and 255, so it does NOT support UNICODE. |