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 / array subscript out of bounds, Why???

Author
Message
Daniel wright 2311
User Banned
Posted: 14th Oct 2011 01:32 Edited at: 14th Oct 2011 01:34
Ok, Im lost here,I thought I was doing this right,here is my code.
its giving me the error array subscript out of bounds.




I thought I had everything right, Am I using the array right or not?

my signature keeps being erased by a mod So this is my new signature.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th Oct 2011 01:38
enemy(i) is wrong. i = 1 to 4.

Daniel wright 2311
User Banned
Posted: 14th Oct 2011 01:42
Lol,right,lol,ok, I changed the tottal numbers for my array, but now it tells me the object number is illeagle,this is the object number.

enemy(i).estates



my signature keeps being erased by a mod So this is my new signature.
Daniel wright 2311
User Banned
Posted: 14th Oct 2011 01:49
is this not legit?



my signature keeps being erased by a mod So this is my new signature.
Daniel wright 2311
User Banned
Posted: 14th Oct 2011 01:56
Dont worry,I figured it out,lol,here is all I did,I think Im just tired.



my signature keeps being erased by a mod So this is my new signature.
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 14th Oct 2011 04:11 Edited at: 14th Oct 2011 04:11
Daniel wright 2311,

In loops like this, It's a good idea to check if something exist prior to hammering away on it.

So in your Type, add some type of STATUS field.

(Pseudo Code)



Login to post a reply

Server time is: 2026-07-11 09:49:22
Your offset time is: 2026-07-11 09:49:22