Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Using Data files — Gideros Forum

Using Data files

ArtLeeAppsArtLeeApps Member
edited July 2013 in General questions
Hi all,

Im using the handy "dataSaver.loadValue".
which works a treat.

In Main, i check for it, and use/create the data within. (the code would look familiar :) )

eg.
sets = dataSaver.loadValue("sets")
 
-- if sets not defined (first time)
-- set defaults
if(not sets) then
	sets = {}
	sets.sounds = true
	sets.music = true
	sets.curLevel = 1
	sets.levelUnLocks = {}
	sets.levelUnLocks[1] = 1
	sets.advertising = true
	dataSaver.saveValue("sets", sets)
end
My question is.
- Is it "OK" to open this file ONCE in Main.
- In other scenes, update "sets" and saveValue as needed.
- But never loadValue during the rest of the app ?

Its more of a "tiny" thing, as i do tend to loadValue in other places, when i dont think in need to. as the "sets" is a global.


Likes: johnyc100

+1 -1 (+1 / -0 )Share on Facebook

Comments

Sign In or Register to comment.