I have a diconary like the one below. I have a variable saved with the current index, ie: “Z-6”, how would i be able to get the next one, “DC-15X”, or go back one to the “DC-15A”, all the way the the end of the table.
Example: If the index variable is set at E-5, how can i navigate foward to “DC-15S”, or backwards to “L5”
Table:
local prices = {
["Z-6"] = {
["BM"] = 5000,
["TGRA"] = 4800,
["Pass"] = 111807495,
},
["DC-15X"] = {
["BM"] = 5000,
["TGRA"] = 4800,
["Pass"] = 111807810,
},
["L3"] = {
["BM"] = 500,
["TGRA"] = nil,
["Pass"] = 112055269,
},
["L5"] = {
["BM"] = 1500,
["TGRA"] = nil,
["Pass"] = 112057014,
},
["E-5"] = {
["BM"] = 1750,
["TGRA"] = nil,
["Pass"] = 112059827,
},
["DC-15S"] = {
["BM"] = nil,
["TGRA"] = 1750,
["Pass"] = nil,
},
["DC-15A"] = {
["BM"] = nil,
["TGRA"] = 2500,
["Pass"] = nil,
},
}