Code: Select all
storage[brand$][numbers1$][numbers2$][numbers3$] = { ["2.5"] = {}, ["3"] = {}, ["3.5"] = {}, ["4"] = {}, ["4.5"] = {}, ["5"] = {},
["5.5"] = {}, ["6"] = {}, ["6.5"] = {}, ["7"] = {}, ["7.5"] = {}, ["8"] = {}, ["8.5"] = {},
["9"] = {}, ["9.5"] = {} }
Code: Select all
ForEach(storage[brand$][numbers1$][numbers2$][numbers3$], p_CreateBoxInputButton)
Function p_CreateBoxInputButton(key, square)
TextOut(textx, texty, key, {name="text"..buttonnumber})
Naturally there is much more code here, but to put it short, idea is that it wil list all those numbers and purpose would be that it would list them in order of:
2.5
3
3.5
4
4.5...
However, now when i use that foreach function to go through all these numbers, what i in practice get is all the numbers in same order each time, but in wrong order.
They go in way of:
4.5
3.5
6.5
2
5
4
7...
I tried to look from manual, but i couldnt quite figure out wether it is possible to sort tables or not.
For notice that these numbers are not actually numbers, but strings, and not just strings, but tables that are named as strings.
So is there anyway that i can sort these tables so that when i use "ForEach" command, it would bring them out in order of 2.5, 3, 3.5, 4...
or do i need to rewrite my program (which is possible, but this had just been better way to do it)