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 / Wierd image loading problem...

Author
Message
iaretony
23
Years of Service
User Offline
Joined: 6th Jun 2003
Location:
Posted: 3rd Dec 2003 01:59
I changed a BUNCH of the code of my game without re-running (I know, a bad thing to do with DarkBasic), and now I'm getting a wierd error... When I choose "PLAY" from my main menu, a dialog box pops up that says:

Runtime Error 501 - Image number illegal at line 1121

Ok, here is the wierd part. The first thing my code does is load ALL of the images the whole app needs, so by this point, ALL of the image are loaded.

The second wierd thing is this: line 1121 is an :endcase! I have this SELECT statement that assigns an image number to a variable based on another variable.

case ICE_CUBE_COLOR_COLOR8:
image_num = 135
:endcase

paste image image_num, a, b, 1

I rewrote the code to use a bunch of IF's instead of a SELECT and I get the same thing!

Anyone ever see anything like this before?

Tony

DcZee
23
Years of Service
User Offline
Joined: 28th Apr 2003
Location:
Posted: 3rd Dec 2003 04:03
im not familiar with the way you ahve those lines coded:
usually I do

case <#> : <do it> : endcase

or
case <#>
<do it>
endcase

it may be correct the way you are doing it,..

also,..I usually get strange errors like that if I have accidentally left off an endif or encase or something simlar in a previous loop. DBPro seems to be able to interpret an unintentional open loop until its mind finally snaps at a lower part of the program. Then it reports the error there,..and not further back where the loop as originally left unclosed. Just a suggestion: check backwards for an unclosed set,...
Jaze
22
Years of Service
User Offline
Joined: 20th Nov 2003
Location: Connecticut, USA
Posted: 5th Dec 2003 10:20 Edited at: 5th Dec 2003 10:21
Hey - this may or may not help but under some circumstances your variable may not have the value you think it does - like a simple type: hello$="hello" : PRINT HELL$

like its not global - misspelled - any thing like that. I know - vague - but in this lang - without option explicit - one char can totally leave you REMSTART'n chunks of code to narrow down stuff debugging.

So you may actually have a line of code doing a paste image ZERO
dilly popping the DarkBasic "five-Oh" on yur prog

-=/Jaze/=-
Jaze
22
Years of Service
User Offline
Joined: 20th Nov 2003
Location: Connecticut, USA
Posted: 5th Dec 2003 10:31
2500 lines of running code in one day and night - HOLY COW you're AWESOME!

Even if you managed over 1000 lines thats working decent is nothing to snub at

Cool - (I know the blow losing code can be) If its got value - copy it somewhere else time and again - consider a batch file that copies the source each time you reboot to somewhere different - another dir, ftp to another machine - a shared network drive - something

-=/Jaze/=-

Login to post a reply

Server time is: 2026-07-26 20:16:36
Your offset time is: 2026-07-26 20:16:36