Save A Variable and load it

Hey guys how do I save a variable then load it on next application opening.

For Example in my game I have money and when someone buys something I want it to save the amount left.

Any Help? Thanks Tyler Jacobson

There are several different methods depending on if you want to save one value, a bunch of separate key-value pairs or a table of data.  For saving a table of data I recommend:  https://coronalabs.com/blog/2014/10/14/tutorial-saving-and-loading-lua-tables-with-json/

If you just want to save one value, that’s easy to do with Corona SDK’s existing file.* API calls. 

A popular module from the community called GGData is good for key-value pairs.

Rob

There are several different methods depending on if you want to save one value, a bunch of separate key-value pairs or a table of data.  For saving a table of data I recommend:  https://coronalabs.com/blog/2014/10/14/tutorial-saving-and-loading-lua-tables-with-json/

If you just want to save one value, that’s easy to do with Corona SDK’s existing file.* API calls. 

A popular module from the community called GGData is good for key-value pairs.

Rob