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 / Memblock error... need help! :)

Author
Message
enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 29th Dec 2010 21:24 Edited at: 29th Dec 2010 21:35
Anyone able to point out what's wrong here?



Keep getting an out of bounds error on the memblock:
Runtime Error 5101 - Memblock range is illegal at line xxx

EDIT:
This has been solved. For those of you with similar errors, my problem was that I was looking for a memblock in the range 0-65535, but memblocks only range from 1-255.

So the correct code is: mbIndex = rnd(254)+1

Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 29th Dec 2010 21:30 Edited at: 29th Dec 2010 21:33
Perhaps you got a memblock ID illegal error on this piece of code:



Try changing it to
mbIndex = 1 + rnd(MAX - 1)
[edit] I think 65535 might be too high too!
[edit] Too late...

Well, it shouldn't give an error every time though. So I'm not sure if this is the only thing wrong in your code. But if it's a memblock error, then this could produce it.

Cheers!
Sven B

enderleit
19
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 29th Dec 2010 21:32
Actually you are right about the piece of code, except the error was that memblocks only range from 1-255...

Good job reading the manual on my part...

Thx anyway...

Login to post a reply

Server time is: 2026-07-19 07:37:23
Your offset time is: 2026-07-19 07:37:23