I have a program using SaveState (Android).
I have a program using SaveState (Android).
On the first version i had 6 parameters.
saving 6 parameter onsavestate.
On form show
if SaveState.Stream.Size > 0 then
begin
..... Read 6 parameters
end
else
begin
.... initialize
end
However now i need to add more parameters
here i will have problems.
if SaveState.Stream.Size > 0 then
begin
read 8 or more parameters
My only solution is to DELETE the program and reinstall it.
BUT I DO NOT WANT TO ASK the users to uninstall
SO WHAT IS THE SOLUTION FROM ONE VERSION TO the other
when more parameters are added ?
On the first version i had 6 parameters.
saving 6 parameter onsavestate.
On form show
if SaveState.Stream.Size > 0 then
begin
..... Read 6 parameters
end
else
begin
.... initialize
end
However now i need to add more parameters
here i will have problems.
if SaveState.Stream.Size > 0 then
begin
read 8 or more parameters
My only solution is to DELETE the program and reinstall it.
BUT I DO NOT WANT TO ASK the users to uninstall
SO WHAT IS THE SOLUTION FROM ONE VERSION TO the other
when more parameters are added ?
store the number of parameters in the stream :)
ReplyDeletePaul TOTH Thanks. SaveState.Stream.SetSize(); right?
ReplyDeleteyou don't say how you store your data so I can't tell you...
ReplyDeleteYour first parameter could have been a version number or the number of parameters that were saved.
ReplyDeleteCan you access the stream position to assess if you have reached the end of the stream before trying to read the new parameters?
Lars Fosdal i am jumping from one project to another. customer problems. i will return
ReplyDeleteLars Fosdal used your idea thanks "the number of parameters"
ReplyDeleteWhats function savestate for, i use tinifiles to save setting
ReplyDeleteIrwanto Irwanto It is used on Android to save parameters. I fixed it by Lars Fosdal suggestion added a count of last save.
ReplyDelete