|
Post by d354n on Mar 14, 2017 17:39:24 GMT
Is there a way to save a multi array to a file? then how to load it back to array? thanks
|
|
|
Post by Mercobots on Mar 15, 2017 10:03:45 GMT
Try something like this
--save the file
file = io.open(scriptPath() .. 'array.lua', 'w')
file:write('return {"valu1","value2"}')
file:close()
-- get the array
myArray = dofile(scriptPath() .. "array.lua")
for i, v in ipairs(myArray) do
print(i, "-", v)
end
|
|
|
Post by d354n on Mar 15, 2017 13:06:08 GMT
thank you again farrusco, you are so smart
|
|
|
Post by Mercobots on Mar 15, 2017 13:56:01 GMT
thank you again farrusco, you are so smart google is smart not me
|
|
|
Post by d354n on Mar 15, 2017 14:47:42 GMT
|
|
|
Post by d354n on Mar 15, 2017 15:01:30 GMT
it actualy working just need to change type( to typeOf( thanks ankulua
|
|