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 / File Does Not Exist???

Author
Message
Pure DARKness
19
Years of Service
User Offline
Joined: 22nd Jul 2005
Location: Coming 4 u
Posted: 18th Aug 2005 04:52
Everytime i try to run my game, the comp comes up and says SYNTAX ERROR AT LINE 46.FILE DOES NOT EXIST. It was a wait command. Sometimes it even comes up and says that its at line 76 when i havent even gone there. Any of yall got som advice 4 me?
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 18th Aug 2005 10:12
Without you posting code there's no way for us to be able to see where the error is.

Post with the code snips.

Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 18th Aug 2005 13:07
DBC often highlights the wrong lines when having a syntax error. So this is normal.

The possible solutions for your problem are:
- Recheck the name + extension of every single file you load.
- Check if the files that should be loaded are all in the same directory as your DBA file.
- If you changed your directory before you load something, it may search for the file in the wrong directory. Change the directory back to the directory of your DB file.

Immunity and Annihalation makes Immunihalation...
dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 18th Aug 2005 17:39
Also, make sure you assigned the right numbers to all the images you loaded.

Like:


That is a mistake I make often

------------------------
Visit my website of Games!
http://dabip.stonerocket.net
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 18th Aug 2005 19:15
I don't think that.

When using wrong numbers, it gives the error: "image does not exist" or "object does not exist" etc.
But when he gives "file does not exist" means he's trying to load, but he cannot find the file.

Immunity and Annihalation makes Immunihalation...
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 19th Aug 2005 01:03 Edited at: 19th Aug 2005 01:04
Image Does Not Exist errors are Runtime errors because DB has no way of knowing that an image/object/sound does not exist until the program is running and it tries to load it.

Most Runtime errors are reported by DB when they are caught, which in the case of programs that use Sync On, are at the line at which you do the Sync command (when the screen is being updated).

To find the correct line number of the error, simply change Sync ON to Sync OFF in your program and run it again.

With Sync Off, DB should report back the correct line number +1.

If you are using Dark Edit or the DB built-in editor, it says the error line is 1 higher than it actually is, so you just look at the preceding line. (I've been testing this out quite extensively for my DB Classic IDE just recently so it goes to the correct line when there's an error)

As such, with Sync On, errors usually stop on the line just before a Sync command which can be confusing.

TDK_Man

Login to post a reply

Server time is: 2025-05-22 12:56:17
Your offset time is: 2025-05-22 12:56:17