Type Function Library system.* Return value Boolean Revision Release 2024.3703 Keywords system preference, setPreferences See also system.getPreference() system.deletePreferences()
Writes a table of preference values to storage. If any of the given preferences do not exist in storage, they will be inserted. If any of the given preferences already exist in storage, they will be overwritten.
Returns true
if all of the given preferences were written to storage successfully. Returns false
if at least one of the given preferences failed to be written to storage.
"applicationExit"
system event.system.setPreferences( category, preferences )
String. Indicates which set of preferences should be accessed on the system. Currently, only the "app"
category is supported — this is the application's custom preferences defined by the Corona app developer.
-- Write this app's custom preferences to storage local appPreferences = { myBoolean = true, myNumber = 123.45, myString = "Hello World" } system.setPreferences( "app", appPreferences ) -- Read the preferences that were written to storage above local myBoolean = system.getPreference( "app", "myBoolean", "boolean" ) local myNumber = system.getPreference( "app", "myNumber", "number" ) local myString = system.getPreference( "app", "myString", "string" )