This cannot been say enough. its have been happens some times here, im are not sure why. but please allways do auto backup save files, if the first one should been corrupted. Its have been happens in Greedy Mouse and hence got 1 star review due that.
In the recent version, im do uses double file saving now, due im cannot trust glbasic at all in this area.
Recently its have been happens TWICE in Karma Miwa (again today), which is quite annoying. Its look like GLBasic does not close files correctly when CLOSEFILE() is sent, or its "crash" here and then simply just delete the file or corrupt it instead.
That is a high profile bug, and the most annoying, im have no clue why its happens (other than the game was in suspended mode while the game was on, me thinks).
Here is the save file to been used:
FUNCTION SaveStrOnce: File$, Base$
LOCAL ok, st$, sc$
ok=OPENFILE(1, File$, 0)
IF ok=FALSE THEN RETURN
LOCAL number=342347
FOREACH item IN MyVar[]
IF item.File$=Base$
FOREACH item2 IN item.VAR[]
number=number+1
st$=URLENCODE$(item.File$)+"|"+URLENCODE$(item2.Name$)+"|"+URLENCODE$(item2.Value$)
sc$=st$
st$=TRIM$(ENCRYPT$("C32(&@3)4"+number+"/&fsd"+HashCrypt$(File$), st$))
LOCAL h$=TRIM$(HashCrypt$(st$))
st$="#"+st$+"#"+h$
WRITESTR 1, st$+"\r\n"
NEXT
ENDIF
NEXT
CLOSEFILE 1
ENDFUNCTION
FUNCTION SaveStrAll: File$, NotSave$=""
LOCAL ok, st$, sc$
ok=OPENFILE(1, File$, 0)
IF ok=FALSE THEN RETURN
LOCAL number=342347
FOREACH item IN MyVar[]
IF (item.File$<>NotSave$ OR NotSave$="") AND item.File$<>"Input" AND item.File$<>"Sprites" AND item.File$<>"Files"
FOREACH item2 IN item.VAR[]
number=number+1
st$=URLENCODE$(item.File$)+"|"+URLENCODE$(item2.Name$)+"|"+URLENCODE$(item2.Value$)
sc$=st$
st$=TRIM$(ENCRYPT$("C32(&@3)4"+number+"/&fsd"+HashCrypt$(File$), st$))
LOCAL h$=TRIM$(HashCrypt$(st$))
st$="#"+st$+"#"+h$
WRITESTR 1, st$+"\r\n"
NEXT
ENDIF
NEXT
CLOSEFILE 1
ENDFUNCTION