This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
How would I make a computer store info
Started by diamondpumpkin, 29 April 2015 - 05:32 PMPosted 29 April 2015 - 07:32 PM
I'm trying to make a computer program that keep tracks of numbers for a money system. I'm not even sure where to start with it or how to store data like a few numbers. Little help?
Posted 29 April 2015 - 08:36 PM
use fs api:
This simple it is.
If youre using tables, use this
the table cannot contain functions or anything but strings nums and bools
local file = fs.open(path,"w")
file.write(data)
file.close()
This simple it is.
If youre using tables, use this
data = textutils.serialize(myTable)
the table cannot contain functions or anything but strings nums and bools
Posted 29 April 2015 - 08:50 PM
I am new at this I barely know what any of that means.
Posted 29 April 2015 - 09:08 PM
fs.open ==> open file, save handler to var file
file.write ==> this info will be written to the file
file.close ==> CLOSES & saves file
file.write ==> this info will be written to the file
file.close ==> CLOSES & saves file
Posted 29 April 2015 - 09:20 PM
Okay, thanks! I made most of my system.
Posted 29 April 2015 - 09:29 PM
You're welcome, and be sure to ask more questions if you need to