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 / noob having trouble

Author
Message
WRappiii
17
Years of Service
User Offline
Joined: 1st Oct 2007
Location:
Posted: 2nd Oct 2007 07:19
Just finished going through a ton of tutorials for DBC. But Ive been unable to load any type of file.

I enter:
LOAD IMAGE "filename.bmp",1
And it returns with "Runtime error at line#. File does not exsist."

I would be able to do so much if could simply load files. Ive changed the file extentions and tried loading up the exsample that came with it and still the files wont load. Hopefully Im doing something wrong that someone can help me with.
-WRappiii
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 2nd Oct 2007 07:41
The clue is in the error message: 'File does not exist'.

For you to be able to load anything into DB, the file you stipulate MUST be where you say it is. DB doesn't tell fibs - the error message means that the file isn't actually there.

If you use:

LOAD IMAGE "filename.bmp",1

then the file "filename.bmp" must be in the same directory as the program (.DBA file).

If it isn't (and it's better that it is), then you have to include the full path to the file.

It's better to use Windows Explorer to copy the required files into your DB project folder before adding the load lines to your program.

TDK_Man

Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 2nd Oct 2007 11:34
Don't call yourself a noob, it has a negative connatation. You are any of the following that do not insult yourself...

Rookie
Amatuer Indie
Starter Coder
Newbie

Noobs can be seasoned people too, it most often means a person being totally stupid and knowing they are being stupid..so relax you're not.

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 2nd Oct 2007 17:59
haha I remember doing the exact same thing as a noob
Like TDK said, you have to point DB to where the file is located.

In programming, nothing exists
Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 3rd Oct 2007 00:18
Quote: "Like TDK said, you have to point DB to where the file is located."


Sooooo true. I once saw it posted in a thread that
Quote: "... you get out of DBC what you put into it..."
Those were very wise words.
Also Zombie 20 is right. If you go around calling your self a noob, people think there is something (mentally) wrong with you, but if you call your self a:
Rookie
Amatuer Indie
Starter Coder
Newbie

then people think:
Quote: " Oh, hes new and needs help getting used to the language but is fully competent "



Maryville Game Developers
Visit our website at http://www.freewebs.com/maryville-game-developers/index.htm
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 3rd Oct 2007 02:28
yeah but noob means you are being a retard BECAUSE you are new and don't know what to do.

In programming, nothing exists
WRappiii
17
Years of Service
User Offline
Joined: 1st Oct 2007
Location:
Posted: 3rd Oct 2007 05:57
I do feel like a real rookie, but I entered the following into DB but it still gives me the same old message :

LOAD IMAGE "C:\Program Files\Dark Basic Software\Dark Basic\myproj\experiment",1

Of course it was all on one line. Once again I hope I'm wrong somewhere. And thanks for the all the help so far.
-WRappiii
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 3rd Oct 2007 07:29
LOAD IMAGE "C:\Program Files\Dark Basic Software\Dark Basic\myproj\experiment",1

See what you put there?

You are telling DB to load an image file called experiment. It won't (or shouldn't) exist because images usually have an extension which tells programs what type of image they are. Examples:

experiment.jpg
experiment.bmp
experiment.gif
experiment.png

My guess is that your Windows is misleading you by hiding the file's extension - and therefore the true filename.

In Windows Explorer, right click on the file you think is called 'experiment' and choose properties. This will show you the true filename - most probably experiment.jpg or experiment.bmp.

You can also make your life easier by doing the following:

1. In Windows Explorer, on the menu go to Tools..Folder Options.
2. Click on the View tab.
3. Scroll down the Advanced settings window until you see 'Hide extensions for known file types'.
4. Remove the tick from the box on that line (if there is one).
5. Click the OK button.

If you now go back to the folder where the image is, you should now see the real filename.

And finally, as I said before, you are much better off copying the image to the folder where your program is. You can get rid of all that C:\Program Files\Dark Basic Software\ stuff and replace it with just the image filename. As in:

LOAD IMAGE "experiment.jpg",1

TDK_Man

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 3rd Oct 2007 18:06
yeah i hate that how windows hides extensions!
they are useful and sometimes essential! aarrgh

In programming, nothing exists
luke810
18
Years of Service
User Offline
Joined: 4th Sep 2006
Location: United States
Posted: 4th Oct 2007 03:32
But you can set them to show file extensions even if they are recognized by your computer if you want so it doesn't really make a difference. It's just more visually appealing to people not to have weird 3 letter extensions on all their files when they dont know what they're for apparently.
WRappiii
17
Years of Service
User Offline
Joined: 1st Oct 2007
Location:
Posted: 4th Oct 2007 04:10
Thank God it worked! Now I can finally start making actual games!Thank you for the help!
-WRappiii

Login to post a reply

Server time is: 2025-05-31 20:36:07
Your offset time is: 2025-05-31 20:36:07