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 / Write to File Help

Author
Message
Nebin
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: At my computer?
Posted: 29th Aug 2006 22:21
I have been working on a 2d gauntlet type game and just “finished” the level editor. It seems to run fine up until it hits the “If FILE EXIST(LevelName$)= 1 then DELETE FILE LevelName$” line. If the file exists it does not delete it so I get an error at the next line telling me the file already exists. If the file does exist it continues to make them but won’t actually write anything to them. I can’t figure it out so any help is appreciated.

Here is the code...



A picture is worth a thousand words...in basic
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Aug 2006 00:36
Ok, you DELETE FILE, then you MAKE FILE, then you OPEN TO WRITE which fails because the file exists ... which one of these commands do you think you can get rid of so that the file doesn't exist when you want to open for writing?

Nebin
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: At my computer?
Posted: 30th Aug 2006 01:37
O...So I don't need to make a new file to write to one. Cool!

Thanks! That fixed it.

A picture is worth a thousand words...in basic

Login to post a reply

Server time is: 2024-09-25 07:21:19
Your offset time is: 2024-09-25 07:21:19