ID:156399
 
Hey,

I know there are really long ways to go about doing this, and I've searched for hours but generally all the topics I found are about sorting lists in regards to numbers.

I'm looking to be able to sort user-made lists alphabetically. It should take into account that there may be words that start off the same, but may be different. ie "psyche" and "psychology". Or, "green" and "green box".

What would be the best way to approach this?

-- Joh!
Lists can be lexicographically compared using the same operators as numbers. A sorting algorithm that works on a list of numbers will work with a list of text strings without any modification, except you may possibly wish to use lowertext() on the text strings, or else capital letters will be sorted before lower-case letters.
In response to Garthor
I tested using text2ascii and comparing the values as the numerical order is the same on that. The ordering actually worked quite successfully, but later I had an issue regarding the second or third characters.

For example, the words would order like apple, boat, cat.

However, if I had originally, apple, boat, ant, cd-rom, cat... the list would return like so: apple, ant, boat, cd-rom, cat.

I'm currently wondering the best way to approach this... I was thinking the while statement might work well, but haven't had much success.

[Edit: Garthor - Thanks for the tip! So would a trip to Deadron's list library be in order then?]