|
-
Jan 27th, 2000, 07:37 PM
#1
Hi,
Does anybody know of a routine to sort a string array VERY fast? I have been using a BubbleSort routine I wrote, but it's pretty slow. I have tried some other sort routines, but they also are slow.
Thanks
------------------
Richard Moss
[email protected]
http://www.users.globalnet.co.uk/~ariad/
-
Jan 27th, 2000, 08:23 PM
#2
Frenzied Member
It could be classed as cheating but I would create a listbox on the form, make it invisible, set it's Sorted property to TRUE and do this;
Listbox1.clear
For i=0 to 100
listbox1.additem myarray(i)
next
for i=0 to listbox1.listcount-1
myarray(i)=listbox.list(i)
next
I haven't tested this but it should be ok - you're just writing stuff into a listbox, and then reading it out - providing the array isn't that massive it should be quite quick.
------------------
Mark "Buzby" Beeton
VB Developer
[email protected]
-
Jan 27th, 2000, 09:01 PM
#3
Mark,
Thanks for the reply.
Unfortuantly, in this case this is not an option, as the sort is required in a class module and everything must be pure self contained code.
Thanks anyway!
------------------
Richard Moss
[email protected]
http://www.users.globalnet.co.uk/~ariad/
-
Jan 27th, 2000, 11:41 PM
#4
Check out htis site:
http://www.cs.ubc.ca/spider/harrison...ting-demo.html
It has demos and code for all kinds of sorts.
------------------
Boothman
There is a war out there and it is about who controls the information, it's all about the information.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|