Storing data in a variable after program is closed

I have my variable lastPlayer in my GlobalData table ( GlobalData.lastPlayer). How do I keep this value stored after the program is closed? I need the answer in simple terms because I got confused and couldn’t keep up with other forum replies. 

https://docs.coronalabs.com/api/library/system/setPreferences.html

My Puggle library can help you here - https://forums.coronalabs.com/topic/70253-the-puggle-framework/

You could save your value like this:

puggle.data:set( "lastPlayer", lastPlayerValue )

And then access it like this:

local lastPlayerValue = puggle.data:get( "lastPlayer" )

 

https://docs.coronalabs.com/api/library/system/setPreferences.html

My Puggle library can help you here - https://forums.coronalabs.com/topic/70253-the-puggle-framework/

You could save your value like this:

puggle.data:set( "lastPlayer", lastPlayerValue )

And then access it like this:

local lastPlayerValue = puggle.data:get( "lastPlayer" )