So, if i understand you right, you need to set the tabel name as variable
to do so, you can try
i don't know if this is supported in Game Guru and its the only way i know how to do this in lua.
so you may try:
Fruits = {}
Vegetables = {}
Meats = {}
Files = {"fruits.dat", "vegetables.dat", "meats.dat"}
Datasets = {Fruits, Vegetables, Meats}
function Example()
for t = 1,3 do
local File = io.open(Files[t], "r")
if File ~= nil then
for v = 1,10 do
--[[Number v value of the table t inside table Datasets]]-- = File:read("*1")
-- I've tried Datasets[t][v] and even "" .. Datasets[t] .. ""[v], but they don't work
_G["Datasets[t]"][v] = value
end
end
File:close()
end
end
can't test this as i'm not on my GG-Computer
AND: never tried this with tables..
Edit: if it don't work with tables, you can also try:
Fruits = {}
Vegetables = {}
Meats = {}
DataSetName=""
Files = {"fruits.dat", "vegetables.dat", "meats.dat"}
Datasets = {Fruits, Vegetables, Meats}
function Example()
for t = 1,3 do
local File = io.open(Files[t], "r")
if File ~= nil then
for v = 1,10 do
--[[Number v value of the table t inside table Datasets]]-- = File:read("*1")
-- I've tried Datasets[t][v] and even "" .. Datasets[t] .. ""[v], but they don't work
DatasetName=Datasets[t]
_G["DatasetName"][v] = value
end
end
File:close()
end
end