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 / Runtime Error at Line 89

Author
Message
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 10th Nov 2007 14:56
This is first question I have ever asked about this game. Now, here is the exact error,

Runtime Error at Line 89. Scale must be between 0 and 250000.

Here is the bit of code is says the error is in,



STOP reading my signature!
LBFN
18
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 10th Nov 2007 16:36
I didn't see anything in your code that would give you this error, so I made up a mock program to test it. It worked fine on several occasions and did not give the error you mention. When it got to zero, the sprite simply disappeared. The program kept cycling through and did not error.

Are you sure this is the area where the error is coming from? I don't see it. It might help if I could see all of your code. If you don't want to post all of the code here, you could email it to me.

LB


TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Nov 2007 17:20
My guess would be that in your code you are altering the value of the variable 'hunger' so it becomes negative.

When you hit the line:

Stretch Sprite 22,hunger,100

it causes the runtime error. To test this, immediately before the stretch sprite line add the line:

If hunger < 0 Then End

If the program stops before erroring then that is the problem.

Are you altering the value of hunger anywhere else in your program?



You do a range check immediately after the line hunger = hunger - Rnd(5) but you might not be doing it elsewhere in your program after altering the hunger variable.

This is the only thing I can think of that might be causing the problem.

TDK_Man

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 10th Nov 2007 18:39
You are awesome!

STOP reading my signature!

Login to post a reply

Server time is: 2025-05-31 20:31:03
Your offset time is: 2025-05-31 20:31:03