This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
dimitriye98's profile picture

Simple data persistence.

Started by dimitriye98, 09 September 2012 - 07:13 PM
dimitriye98 #1
Posted 09 September 2012 - 09:13 PM
A simple api for making persistent variables. You can use store(name, value) to save a variable and pull(name) to get the value of a previously stored one. Using store(name, nil) or just store(name) (since no input defaults value to nil) will delete the variable.

http://pastebin.com/AN8S6GHp
dimitriye98 #2
Posted 29 September 2012 - 12:23 AM
Can someone reply please?
Sebra #3
Posted 29 September 2012 - 09:35 AM
Simple and was made many times.
But should work (not tested).
7Roses #4
Posted 01 October 2012 - 03:00 PM
maybe take a look at my code?
have improved so you don't need to type your variable name EVERY time you want to save something
also it's a bit more OOP :)/>/>
(haven't tested it yet so hope it doesn't contain some bugs)

http://pastebin.com/b3zcQKye