|
Hi to all. I have 10 variables:
How i can order the variables in max order? in javascript please EXAMPLE:
1 --PLAYER 10 ------------> 333 ---Thank you in advance!
(comments are locked)
|
|
Hi Raul, Use arrays and use sort() function. Here it is one example link text Good to know some Spanish people are around ;) gracias Uzquiano, aqui estamos los espaoles escondidos xdd
Mar 17 '11 at 02:15 AM
raul corrales
(comments are locked)
|
|
First, you'll want to use a container (such as an array or List) rather than separate variables. Once you have the data stored in a container, you can use one of the .NET 'sort' functions to sort the elements of the container using a custom comparator that implements the desired sort order. thanks for reply!
Mar 17 '11 at 02:23 AM
raul corrales
(comments are locked)
|
|
Well, for the baptism of it, I'll extend your existing code to support sorting. While the code works (yes I even tested it), this is absolutely not good practice and should be considered mostly as a lesson in extremely redundant coding. The preferred way is of course using lists as the other answerers suggest (and I cheat a bit in my example, don't I?) thanks for the example!
Mar 17 '11 at 02:18 AM
raul corrales
This is not an example of a good way of doing this so I feel it's quite ironic you accepted this answer :P
Mar 17 '11 at 12:04 PM
Statement ♦♦
(comments are locked)
|
