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

Sort String Segments Function
String Lists Class

Public Function SortStringSegments( _
      ByVal vValue As Variant _
    , ByVal vSegmentLength As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Variant

Sort the sub-string segments contained in vString using the sort order/collating sequence vCompare.

Examples:
    SortStringSegments("050102060403", 2, vbBinaryCompare) = "010203040506"
    SortStringSegments("Wa Or nv Ca az ", 3, vbBinaryCompare) = "Ca Or Wa az nv "
    SortStringSegments("Wa Or nv Ca az ", 3, vbTextCompare) = "az Ca nv Or Wa "
See also:
    SearchSortedStringSegments Function
    ShuffleStringSegments Function
vValue: String containing the equal-length segments which are to be sorted. Function returns Null if vValue is Null or cannot be fixed up to a String.

vSegmentLength: The length of each sub-string segment within string vValue. Function returns Null if vSegmentLength is Null or cannot be fixed up to a number.

Function returns Null if the segment length is < 1 (less than one).

vCompare: Specifies the sort order/collating sequence. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.

Algorithm: Function uses Shell Sort algorithm.

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