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 / Not understanding Load Image problem (could not define parameter)

Author
Message
Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 13th Feb 2011 11:49
For some reason i cant seem to load an image. I have tried a few different ways and gone over the spelling of things to make sure its right.

To load an image i must do the following i think.
1) Create it.
2) Save it (as a recognised format, bmp will do)
3) Make sure it is in a folder that will be the same as the project folder.
4) Open DB pro
5) Type at least the following code.

6) Check spelling and capitals are the same
7) save project as (then save it in the same directory)
8) Compile (it wont do anything because i am not using the image in any way but it SHOULD compile yet all i get is a could not define parameter type at line blah blah.)

I have also used things like Sync On and Sync Rate 60 etc just to set up the screen. But i cant find anything wrong with Load Image. What on earth am i doing wrong.

I have noticed it do this on me before which i believe is a bug in DB pro as i have managed to fix it on other lines of programs like the pong program by literally deleting the line and re writing it EXACTLY as it was before. One minute it compiles the next it doesnt, re write it then it works again. But i have re wrote this line and deleted the whole project and folders and everything and started again numberous times and still cant get it to work.

Please help!
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 13th Feb 2011 13:20
Em, you can't load it, so you get an error, right? Like "Cannot read image *blah blah*"? If yes, i have my own solutions for that. First of, maybe you gotta have dark basic project, not only source code. So in let's say GAME folder you need GAME.dbo and GAME.dba. Hope it'll help.

In progress of making Archery Simulator... Or maybe not simulator x]?

@There'll be a sig @
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 13th Feb 2011 13:32
Hi somarl.

i used the following code to display an image on the screen


You will find more information in the help file under image commands.
I know I keep referring you back to the help file, I am not flogging you off or being short, its just that the help file really does do an excellent job of explaining how to use Dark basic commands. And I understand it can be confusing and difficult to know where to look to find how to do things in the very early stages of coding.

now back on topic
one way to ensure you have the correct file path is to use the import media function in the db editor(second tab from the end of bottom left of screen.

this way the file path and file name are on the screen for you to see and can reduce frustrating file name mismatches.

That's about all I have for now
I hope this had been helpful
Kezzla

Sometimes I like to use words out of contents
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Feb 2011 16:56
Quote: "but it SHOULD compile "


No it shouldn't. You left out the comma:

Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 13th Feb 2011 17:32
@Green Gandalf, spot on, your right.

I spent ages trying to work out what i had done wrong (i was looking at vid tutorials in bad resolution and couldnt make out some of the keys, i am a silly boy.)

Unfortunately i figured it out well before this was even posted but my noob status stopped it getting put up right away so i could delete it or whatever. Ha, the simplest things that thwart a noob. Trust me on this i gave myself a slap in the face for that one. 1 hour googling solutions because i left a bloody comma out
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Feb 2011 17:35
The case of the letters on number 6 doesn't matter as long as it's spelled right you're fine. If you run into a problem like this again click on the command and hit F1 to bring up the help files and check/recheck the commands syntax.

Don't ever delete your whole project for a single bug because 99.9% of the time it's a silly mistake(s) you've made in code... as you can see what happens when you accidentally forget one single comma.

Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 13th Feb 2011 23:12
Yeah i would have tried the help command but mine is broken somehow. Its not big deal though as i just bought the full version so ill uninstall everything and reinstall everything properly and hopefully my help files will come back

I think its worth buying as ive tested out the free version long enough to see if i can do something with it, and slowly but surely i think i will.

@Grog - i usually dont delete stuff as i am always convinced its me whos made the error (who else right, especially in the above case)
However i must say that on more than one occasion now i have had an error where it compiled perfectly before a couple of times, then all of a sudden with no code changes or anything at all it has stopped compiling and errored up on a perfectly good looking peice of code so i have retyped over the original letter for letter very slowly and watched as it worked on the next compile, its not a great problem as it even points to the code you need to retype it just makes you think youve done something wrong when you havent. Might just be a few bugs here and there but they are still updating DB pro right?
Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 15th Feb 2011 00:25
DBPro is still being updated, yes, but it's been around for many years now and it's certainly not a new system. I've never encountered a bug that requires the retyping of the line precisely as it was. One piece of advice I have for you is that when you report that something isn't working you should also tell us why not: we need to know what the error message is. It helps a lot in working out what the problem might be! The missing comma was immediately obvious to me, but if you'd posted the error message it might've saved time for the others who posted helpful information without noticing it.

Next time you see DBPro suddenly fail and require you to retype a line, let us know as I've never seen this and I'm curious whether you've found such a bug or whether you're typing more syntax errors.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 15th Feb 2011 08:58 Edited at: 15th Feb 2011 08:59
@ Somarl:

I'm with Agent on this. If you find a piece of code you know is right and it doesn't work you need to post it instead of deleting it. If we deleted everything that didn't work right Darkbasic Pro wouldn't be as bug free as it is today. Most of the time it is us that mess up the code somehow but that .1% is a true bug in Darkbasic that needs to be posted so it can be fixed. Also check the Bug Reports area to make sure what you've found isn't already a known bug.

http://forum.thegamecreators.com/?m=forum_read&i=15

Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 15th Feb 2011 14:38
I checked the bug report section but I think i know what it is so technically its not a DB fault (then again not mine either sort of)
I copy pasted the code from a site and noticed a few things wrong with it, like the way it posted plus signs as something odd. So i changed them (thinking im all smart for spotting them) but i think its obvious i either didnt get everything or there is something wrong with copy pasting from that site. Cant remember where it is now as i didnt bookmark it. Its not the copy paste itself as ive done that loads of times and it works, i just think it was something else that may have got copied over causing the code to stop working. Either way if i come across it i will be sure to make a note of it again and report it so all can see, that was my bad and i should have done that straight off the bat - sorry folks.

Login to post a reply

Server time is: 2024-11-23 02:25:19
Your offset time is: 2024-11-23 02:25:19