View Full Version : Alphabetical order.
Morgoth
07-16-2003, 06:45 AM
Just out of fun and curiosity, has anyone here ever written their own code for how to display text in alphabetical order? Either as a function or something?
No. Never needed to. (I just order them when i pull them out of the db). I know jscript has an order-method for arrays, but i don't believe vbscript has one.
Morgoth
07-16-2003, 08:27 AM
I figure someone here must of at some time in their life...
Whammy? I know you have done alot of functions.
oracleguy
07-16-2003, 05:06 PM
I know a friend that wrote a sub in VB to order items in alphabetical order. However, they went on vacation starting today and won't be back until Monday. :(
But I'll have them post it in when they get back.
CrzySdrs
07-16-2003, 06:59 PM
I am OracleGuys friend and I just happened to check the boards, here is my god awful code I wrote to alphabetize a set of words and their corresponding words from a list of 40 words. This was used as some sort of a basic dictionary and it just needed to be alphabetized. It only alphabetizes to the first letter of the words but it works. I think it used to do it up to the second letter but it took too long to do it.
strAlphabet = "abcdefghijklmnopqrstuvwxyz"
For intX2 = 1 To 26
strCurrentLetter = Mid(strAlphabet, intX2, 1)
For intX = 0 To 39
strLetter = Mid(strOtherLang(intX), 1, 1)
If strLetter = strCurrentLetter Then
lstTranslations.AddItem strOtherLang(intX) & " = " & strEnglish(intX)
End If
Next
Next
Keep in Mind you could make it more accurate by putting in more For Next guys, but it all became rather stupid once I realized that listboxes had the ability to sort themselves. Once again, VB beat me at my own game.
Morgoth
07-16-2003, 11:01 PM
Har har...
Well, thanks for your input!
scroots
07-16-2003, 11:38 PM
javascript can sort words into alphabetical order, i think.
scroots
whammy
07-18-2003, 03:03 AM
What exactly (besides trying to alphabetize) are you trying to do?
You should be able to use Asc(x) to alphabetize
Morgoth
07-18-2003, 03:16 AM
really?
How does that work?
Do you have to put an array into Asc()?
whammy
07-18-2003, 03:16 AM
Nah, I meant to use some kind of string manipulation to order it. ;)
I might mess around with this idea later. :D
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.