Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Problem with final excecutable save files (DBC)

Author
Message
ManiacBR
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 12th Dec 2006 15:10
I have the high score table working in my game, and it loads and displays the scores and names fine from a dat file.

However, when i make my game into a final executable then when i click to load up my high score table it just displays a row of zeros as if nothing is in the file.

Here's part of my saving code at the moment.



Here's the part of my code that displays the scores when i bring up the high score table,



Any ideas why it's not working in the final excecutable?

Thanks in advance.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Dec 2006 19:19
Maybe your loading code isn't right?

Try putting together a complete example that just deals with the hiscore table - if you still have problems with it, then you can post that complete code here so we can see what is going on.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Dec 2006 13:46
It's a while since I did this, but I'm fairly sure that:

IF FILE EXIST("hiscore1.dat") THEN DELETE FILE "hiscore1.dat"

is the problem. With a build final, as most of the files are inside the exe, this one is probably assumed to be as well.

Use Get Dir$() at the start of your program and use specific paths instead of relative ones:

StartDir$ = Get Dir$()+"\"

Then, when you need to create/use external files use:

IF FILE EXIST(StartDir$+"hiscore1.dat") THEN DELETE FILE StartDir$+"hiscore1.dat"

TDK_Man

Login to post a reply

Server time is: 2024-09-25 13:23:21
Your offset time is: 2024-09-25 13:23:21