To reiterate and clarify on what Fizzlemizz said, tables with strings as keys are stored in a random order. When you use pairs() to print the key,value pairs in a certain order, you're not actually sorting the table, it's just scanning through and reading/printing them in whatever order you define.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh
|