IanMc Well-Known Member Licensed User Longtime User Jan 17, 2013 #1 Am I doing something wrong here? its' not working, keeps logging timesRun as 1 (this code is in Main Sub Activity_Create) Code: Copy If FirstTime = True Then Dim tr As Int If StateManager.GetSetting("timesRun") <> "" Then tr = StateManager.GetSetting("timesRun") tr = tr + 1 Else tr = 1 End If StateManager.SetSetting("timesRun", tr) Log("Times Run " & tr) End If It's me, it must be me
Am I doing something wrong here? its' not working, keeps logging timesRun as 1 (this code is in Main Sub Activity_Create) Code: Copy If FirstTime = True Then Dim tr As Int If StateManager.GetSetting("timesRun") <> "" Then tr = StateManager.GetSetting("timesRun") tr = tr + 1 Else tr = 1 End If StateManager.SetSetting("timesRun", tr) Log("Times Run " & tr) End If It's me, it must be me
mc73 Well-Known Member Licensed User Longtime User Jan 17, 2013 #2 You should use stateManager.saveSettings after the setSetting, otherwise the map is not written to the settingsFile. Upvote 0
You should use stateManager.saveSettings after the setSetting, otherwise the map is not written to the settingsFile.
IanMc Well-Known Member Licensed User Longtime User Jan 18, 2013 #3 Ah yes of course! Thanks mc! Although I use Statemanager.Savesettings elsewhere i can't just presume it gets called after this. That must be the answer! I'll check. Cheers! You know I might just put a call to SaveSettings in the SetSettings subroutine. It won't catch me out again that way Hey this is my 100th post and I got a new star! Yay! :icon_clap: Last edited: Jan 18, 2013 Upvote 0
Ah yes of course! Thanks mc! Although I use Statemanager.Savesettings elsewhere i can't just presume it gets called after this. That must be the answer! I'll check. Cheers! You know I might just put a call to SaveSettings in the SetSettings subroutine. It won't catch me out again that way Hey this is my 100th post and I got a new star! Yay! :icon_clap: