Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Nov 16, 2018 6:00 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: OutOfBoundException while assigning array
PostPosted: Wed Sep 12, 2012 7:24 am 
Offline

Joined: Wed Sep 17, 2008 2:45 pm
Posts: 220
Hello

I have a little problem, I got an outofboundexception while assigning an array, I didn't know this was possible.
Here is the code:

Image
As you see in the image, 'Counter' is 0. So i'm just assigning to arrayCollisionedControls(0)

Does anybody know what I doing wrong here?
Thanks in advance

_________________
My native language is not English.


Top
 Profile  
Reply with quote  
 Post subject: Re: OutOfBoundException while assigning array
PostPosted: Wed Sep 12, 2012 7:40 am 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
It's out of bounds because you haven't set the dimension for the array, so you setting a value that is out of it's dimension.

Instead of using your counter, try using 'Append' to your array:

Quote:
arrayCollisionedControls.append(rct)

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
 Post subject: Re: OutOfBoundException while assigning array
PostPosted: Wed Sep 12, 2012 12:10 pm 
Offline

Joined: Wed Sep 17, 2008 2:45 pm
Posts: 220
Well, you were totally right. God I love this community.
Thanks for pointing that out, I was a bit to used to old VB6/.Net habbits!

_________________
My native language is not English.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group