Posted 06 June 2015 - 05:33 AM
I'm currently working on a program called UPaint which uses a table as a canvas, and I would like to know how I would be able to save that table as a text file and reload it. Thanks in advance! :D/>
local myTable = {} -- Fill this with whatever.
local myFile = fs.open("someFileName", "w") -- http://www.computercraft.info/wiki/Fs.open
myFile.write(textutils.serialize(myTable)) -- http://www.computercraft.info/wiki/Textutils.serialize
myFile.close()
local myFile = fs.open("someFileName", "r")
local myTable = textutils.unserialize(myFile.readAll())
myFile.close()