Click to See Complete Forum and Search --> : organizing letters and numbers


January 6th, 2000, 07:50 PM
the user can enter a one letter letter or number in a listbox... How can I make it so that I can arrange the numbers and letters backwards, like this example:

list1.list(0) = "A"
list1.list(1) = "1"
list1.list(2) = "B"
list1.list(3) = "2"
list1.list(4) = "3"

now, I want to arrange it so that, the elements appear in this order:
B
A
3
2
1
how can I do that?

JimmyT
January 20th, 2000, 07:53 PM
The easiest way (I think) will be to check and compare the ASCII code value for the letter or number that is added to the list. Capital letters A-Z have ASCII values of 65-90, lower case letters A-Z have values of 97 - 122, and numbers 0-9 have values of 48-57. You will probably want to convert any letter that is entered to Upper case and sort the entries in descending ASCII value order.


Good Luck...