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.

DarkBASIC Discussion / open to write problem

Author
Message
DarkMere
21
Years of Service
User Offline
Joined: 7th Aug 2003
Location:
Posted: 12th Aug 2003 19:39
The problem I have is that that code below works perfectly under the interpreter, but when compiled does not save the file, yet there is no run time error when running the compiled version.

delete file "hiscore.dat"
open to write 1,"hiscore.dat"
write float 1,hiscore#
close file 1

If anyone can help I would be grateful
Wik
21
Years of Service
User Offline
Joined: 21st May 2003
Location: CT, United States
Posted: 12th Aug 2003 20:36 Edited at: 12th Aug 2003 20:36
Maybe is't saving it into the compiled program.
Are you makeing a final (with media) or just an exe.

In your game...save the high score and then try to load it.

Or

Try:




-Matt

The rock has rolled!
8truths
22
Years of Service
User Offline
Joined: 10th May 2003
Location: United States
Posted: 12th Aug 2003 20:44
I had to use a full path on mine way back when I did this.

I admire your honesty. Hell, I like you; you can come over to my house and ---- my sister!
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 12th Aug 2003 20:55
Are you making the sure the file doesn't exist before you try to open the file for writing?


Logo design by Indi
Its better than a poke in the eye...
Wik
21
Years of Service
User Offline
Joined: 21st May 2003
Location: CT, United States
Posted: 12th Aug 2003 22:12
He has "delete file" and it doesn't give him a runtime error.

-Matt

The rock has rolled!
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Aug 2003 01:30
First, you should have:

If File Exist("hiscore.dat") Then delete file "hiscore.dat"

... just in case the file isn't there.

Secondly, (and possibly the cause of your problem), are you using F7 to compile? If so, try deleting the hiscore file before compiling.

Maybe this file is being compiled into the exe and when you write out the file in your program, it's writing out the data - but not to the file you think it is...

TDK
Wik
21
Years of Service
User Offline
Joined: 21st May 2003
Location: CT, United States
Posted: 13th Aug 2003 05:49
That would make sense.

TDK,
Whens MatEdit Pro coming out?
On your website it says July 2003

-Matt

The rock has rolled!
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Aug 2003 06:46
Mmmm... yes, I'm afraid it's getting a bit behind schedule.

I'm having a few problems at the moment integrating newly created VanTrans textures in real-time. I'll have to amend the info on the web site to avoid further confusion...

Sorry about that.

TDK
Wik
21
Years of Service
User Offline
Joined: 21st May 2003
Location: CT, United States
Posted: 14th Aug 2003 19:01
Oh,
OK I was just wondering...

-Matt

The rock has rolled!

Login to post a reply

Server time is: 2025-05-19 16:20:30
Your offset time is: 2025-05-19 16:20:30