H
Howard Kaikow
Over the past few daze, I've noticed that WordBasic.SortArray does not
always sort strings correctly.
The output of the code below demonstrates that the sort is incorrect, e.g.,
"com" should not appear prior to "convertAnswer" , and "Command1" should not
follow "convertAnswer" in the sorted data.
Option Explicit
'This example demonstrates that WordBasic.SortArray does not sort strings
correctly.
Private Sub WBReal()
Dim a(35) As String
Dim i As Long
Dim strData() As String
a(0) = "Accessing"
a(1) = "Recordset"
a(2) = "provide"
a(3) = "hard"
a(4) = "NotOverridable"
a(5) = "Layout"
a(6) = "your"
a(7) = "servername"
a(8) = "ProjectInstaller"
a(9) = "Premium"
a(10) = "have"
a(11) = "cboCountry"
a(12) = "Gray"
a(13) = "Reset"
a(14) = "tuned"
a(15) = "noticed"
a(16) = "Command1"
a(17) = "com"
a(18) = "State"
a(19) = "problem"
a(20) = "pasting"
a(21) = "responsible"
a(22) = "circles"
a(23) = "returning"
a(24) = "rewrite"
a(25) = "occurred"
a(26) = "convertAnswer"
a(27) = "your"
a(28) = "ADO 's"
a(29) = "Word"
a(30) = "reducing"
a(31) = "Misc"
a(32) = "categorized"
a(33) = "preface"
a(34) = "Alan"
a(35) = "teams"
strData = a
WordBasic.SortArray strData(), False
For i = 0 To UBound(strData)
Debug.Print strData(i)
Next i
End Sub
always sort strings correctly.
The output of the code below demonstrates that the sort is incorrect, e.g.,
"com" should not appear prior to "convertAnswer" , and "Command1" should not
follow "convertAnswer" in the sorted data.
Option Explicit
'This example demonstrates that WordBasic.SortArray does not sort strings
correctly.
Private Sub WBReal()
Dim a(35) As String
Dim i As Long
Dim strData() As String
a(0) = "Accessing"
a(1) = "Recordset"
a(2) = "provide"
a(3) = "hard"
a(4) = "NotOverridable"
a(5) = "Layout"
a(6) = "your"
a(7) = "servername"
a(8) = "ProjectInstaller"
a(9) = "Premium"
a(10) = "have"
a(11) = "cboCountry"
a(12) = "Gray"
a(13) = "Reset"
a(14) = "tuned"
a(15) = "noticed"
a(16) = "Command1"
a(17) = "com"
a(18) = "State"
a(19) = "problem"
a(20) = "pasting"
a(21) = "responsible"
a(22) = "circles"
a(23) = "returning"
a(24) = "rewrite"
a(25) = "occurred"
a(26) = "convertAnswer"
a(27) = "your"
a(28) = "ADO 's"
a(29) = "Word"
a(30) = "reducing"
a(31) = "Misc"
a(32) = "categorized"
a(33) = "preface"
a(34) = "Alan"
a(35) = "teams"
strData = a
WordBasic.SortArray strData(), False
For i = 0 To UBound(strData)
Debug.Print strData(i)
Next i
End Sub