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 Professional Discussion / Started to use DBPro and ran into syntax troubles...

Author
Message
Darkhog
13
Years of Service
User Offline
Joined: 25th Nov 2012
Location: Mushroom Kingdom
Posted: 25th Nov 2012 21:25
I've started to use DBPro today (Free version, though I'm saving money for paid one as I want to support such great guys like you) and I've tried to make simple pong as my learning game.
The code is:

Unfortunately I get runtime error message "Runtime error 501: Image number illegal at line 15". This is first of the sprite lines.
From my understanding I am not allowed to use variables here. WTFirework?
Also why does your BASIC dialect not allow for inline comments using apostrophe character, like most BASIC dialects do? It is certainly easier to push ' than type REM.
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 26th Nov 2012 06:50
try load image rather than load bitmap.

you can still load a bitmap from load image.

I think loading a bitmap has more to do with the backdrop.

you can use a variable to load an image.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 26th Nov 2012 09:42
The command load bitmap will cause the image to be loaded into a "buffer", one could say. You cannot print it to the screen in this form. The command is helpful if you have an image like this:



Because as a bitmap, you can use the command get image to grab certain areas from the active bitmap (to change bitmaps you have to use set current bitmap). Here's a quick example of how you'd read in the above image:



So in your case, just replace load bitmap with load image.

TheComet

Darkhog
13
Years of Service
User Offline
Joined: 25th Nov 2012
Location: Mushroom Kingdom
Posted: 26th Nov 2012 10:34
Thank you both. Sorta figured it myself (before post was approved), but maybe it'll be useful for other people who run into same issue.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Nov 2012 12:19
Quote: "Unfortunately I get runtime error message "Runtime error 501: Image number illegal at line 15". "


The reason for that is that you have loaded your image files as bitmaps not images so DBPro can't find images 1 and 2. DBPro makes a distinction between the two and bitmaps are often used when you want to process the image data in some way.

As Kezzla says, just use load image instead.



Login to post a reply

Server time is: 2026-07-08 01:54:02
Your offset time is: 2026-07-08 01:54:02