|
-
May 24th, 2009, 10:09 AM
#7
Re: VB6: All purpose sort
Actually I do, when sorted they are always after Z. As a character code Ä is before Å, so in binary sort Z < Ä < Å < Ö but in text Z < Å < Ä < Ö.
Date = Double, so you can use the same code for both when sorting.
I think for the numeric data types having one code is enough. I'm not sure yet, but I think multidimensional arrays can be hacked temporarily to look like one dimensional arrays. I can remember that safe array structure had some oddities though, so it may turn out to be a bit harder, but may be doable with relative ease instead of creating tons of code for many multiple dimensions.
Basically Sort, SortB, SortI in total would have three different string functions and seven for the numeric data types (one for each). Only two implementations are required if one sort will be chosen as the main one: string implementation and numeric implementation. Making all the variation function would only require some simple replaces (the first numeric should be of course be done with other than Long or there will be unnecessary replace issues).
Of course before doing any extra copy'n'replace the two implementations must be validated to work perfectly to avoid unnecessary work.
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
|