Well, I'm working on a game for quite some time now and while I had a few dbp-related bugs here and there, it never was a big problem, I always found some kind of acceptable workaround. However, this time it's really strange and I have no idea what I could do about it.
Have a look at this line:
repeat : cls : dir : sync : until file exist(f2$)
I wrote it for debugging purposes since a function didn't do what it's supposed to do. So, f2$ is a filename, in this case "temp" + a number + ".prf", for instance "temp000009.prf".
When the program reaches this line, the dir-command reveals that the file f2$ actually does exist. However, the program doesn't leave this loop and "file exist(f2$)" always returns 0.
It makes absolutely no sense to me, especially since this is nearly exactly the same piece of code I've used several times in my project, and it always worked fine.
Just in case that might help, here the full function:
function SaveUnlockStates()
set dir "Profile\" + profileName
f2$ = FindFreeFile$("temp",6,".prf")
f$ = "state.prf"
F = 1
open to write F, f2$
if Feature_Selected = ft_coop then f = Feature_Prev else f = Feature_Selected
WriteStringFile(F, Unlock(f).name)
WriteStringFile(F, Unlock(skin_head).name)
WriteStringFile(F, Unlock(skin_glasses).name)
WriteStringFile(F, Unlock(skin_hands).name)
WriteStringFile(F, Unlock(skin_feet).name)
close file F
repeat : cls : dir : print : print ">",f2$,"<", " ", len(f2$) : sync : until file exist(f2$)
if file exist(f2$)
if file exist(f$)
tmp$ = "profile.tmp"
if file exist(tmp$) then delete file tmp$
rename file f$, tmp$
endif
rename file f2$, f$
Msg("File " + f$ + " created!")
endif
set dir "..\.."
endfunction
Oh, and by the way, I'm still using DBP 6.6. And since the project is near its completion, I don't really want to install the newest update so soon.