I needed a way to sort an Array of strings.


Sub bubblesort(arry() As String,limit As Integer)
For i = 0 To limit
Call bubblemax(arry,limit-i)
Next
End Sub

Sub bubblemax(x() As String, eff_size As Integer)
For k = 0 To eff_size-1
If x(k) > x(k+1) Then
Call swaparry(x,Cint (k),Cint (k)+1)
End If
Next
End Sub

Sub swaparry(x() As String, i As Integer, j As Integer)
Dim temp As String
temp=x(i)
x(i)=x(j)
x(j)=temp
End Sub

This was first published in November 2000

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.