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 / Beginners Guide To DarkBASIC Game Programming - Demonstration Code Help Required

Author
Message
Symac
20
Years of Service
User Offline
Joined: 3rd Jun 2004
Location: Leigh, Lancs
Posted: 20th Apr 2005 00:43
Hi there.

I learning to program DarkBASIC which is my first attempt at programming. I'm currently working through 'Beginners Guide To DarkBASIC Game Programming' trying all the demonstration code as I work through the book so as to re-enforce my understanding.

I'm currently on chapter 10 which is introducing Bitmaps however when I try the BitmapStatus program which is demonstrating the use of the BITMAP EXIST command I receive the following Runtime Error 1002 - Bitmap doesnt exist at line 20

I've checked my coding and it is a duplicate of the books. I've even tried the code that comes on the CD which accompanied the book yet I still get the same error. I've tried to work through the code and correct it yet I don't understand why the error is occurring.

I've posted the code below in the hope that someone can have a look and advise why the code is failing. I just don't want to move on until I have a clear understanding of how the CREATE BITMAP command works and prevent similar errors in the future.
Cheers in advance
Symac
20
Years of Service
User Offline
Joined: 3rd Jun 2004
Location: Leigh, Lancs
Posted: 20th Apr 2005 18:39
Apologies for the layout of the above post. First time at posting code snippet.

Also forgot to add that i'm using DBPro
Symac
20
Years of Service
User Offline
Joined: 3rd Jun 2004
Location: Leigh, Lancs
Posted: 20th Apr 2005 21:08
I've also noticed and corrected the spelling of the message$ variable in my initialisation statement. This however has not fixed the CREATE BITMAP error.
Guyon
21
Years of Service
User Offline
Joined: 6th Jun 2003
Location: United States
Posted: 20th Apr 2005 22:55 Edited at: 20th Apr 2005 23:01
I have heard that many of the examples do not work with DBpro, though this example looks OK. All it does is PRINT if you made a valid BITMAP or not.

Are you using the current verison of DBpro?
Symac
20
Years of Service
User Offline
Joined: 3rd Jun 2004
Location: Leigh, Lancs
Posted: 21st Apr 2005 00:11
Well don't I feel the prat.

I've just tried the same code on DB Pro with the 5.8 fix and hey presto it works.

Sorry for the pointless topic, but thank you for your help.
wmf
19
Years of Service
User Offline
Joined: 6th Nov 2004
Location:
Posted: 21st Apr 2005 00:16
try it with less bitmaps. you may be running out of memory. I tried it with more and got 106 successfully. when i changed it to 1024x768 i got the same error with 106.
Guyon
21
Years of Service
User Offline
Joined: 6th Jun 2003
Location: United States
Posted: 21st Apr 2005 04:20
No Prob Symac,

Though I did have to look up the word prat. LOL
Symac
20
Years of Service
User Offline
Joined: 3rd Jun 2004
Location: Leigh, Lancs
Posted: 21st Apr 2005 19:20
It was the memory after all. Just tried the code again on my work PC, but this time I reduced the number of bitmaps as suggested by wmf and voila it worked. Cheers wmf

Well they do say you learn by your mistakes so at least I can move forward into the book and start making some more

Just wanted to check if anyone else who has worked through this book had discreppencies with a couple of the answers to the multiple choice questions e.g.
Quote: "Chapter 9 Quiz
3. Which command checks for support of transform and lighting (T&L)?
A. TRANSFORM AND LIGHTING()
B. CHECK TNL()
C. LOOK FOR TNL()
D. TNL AVAILABLE()"


I was certain that it was D. TNL AVAILABLE(), yet the answers state the it is B. CHECK TNL()???????

Also how long does it take before i'm trusted on the forum so that I don't have to wait half a day to see my post?
Symac
20
Years of Service
User Offline
Joined: 3rd Jun 2004
Location: Leigh, Lancs
Posted: 21st Apr 2005 19:22
Quote: "Also how long does it take before i'm trusted on the forum so that I don't have to wait half a day to see my post? "

Not that long I see
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 22nd Apr 2005 05:19
Hehe, smooth !
Fraid i cant help you with the tutorial book, just voicing my amusement !
Good luck.

Login to post a reply

Server time is: 2024-09-23 17:21:15
Your offset time is: 2024-09-23 17:21:15