View Single Post
Old 12-03-2005, 06:21 PM   #1
Koen
Game Wizzard
 
Koen's Avatar

 
Join Date: Nov 2004
Location: Nootdorp, Netherlands
Posts: 226
Default

I'm looking for a fast sorting algorythm to alphabetically sort a list from A to Z.

Code:
Dim Title() as String, NumOfTitles as Long
Dim Temp as String
Dim I as Long, J as Long
This algorythm I always use is too slow, can anyone write a better (optimized) algorythm?

Code:
For I = 1 To NumOfTitles
 *For J = 1 To NumOfTitles
 * *If LCase(Title(I)) < LCase(Title(J)) Then
 * * *Temp = Title(I)
 * * *Title(I) = Title(J)
 * * *Title(J) = Temp
 * *End If
 *Next J
Next I
BTW, is there a function left like the old QB's Swap(String1, String2)?
Koen is offline                         Send a private message to Koen
Reply With Quote