New topic: 

something strange

<http://forums.realsoftware.com/viewtopic.php?t=34214>

         Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic          Author  
Message        azrael2000          Post subject: something strangePosted: Thu 
Jun 10, 2010 10:12 am                         
Joined: Fri Oct 13, 2006 3:18 pm
Posts: 291                Hi All.

I have a little mystery here, that makes no sense to me whatsoever.  Perhaps 
someone can spot my error.

When I run the code shown below, the first array gets filled just fine; the 
second one however gets a OutOfBounds error.  Everything is declared EXACTLY 
the same.  

  Code:for k = 0 to winMain.Listbox1.ListCount-1 //the minus one because the 
listbox is zero based
   mibarray(k) = winMain.Listbox1.cell(k,1)
  next k
  
  for z = 0 to winMain.Listbox1.ListCount -1
  mibarray2(z) =winMain.Listbox1.cell(z,1)
  next z

Then for giggles, I went and changed the 2nd array fill to

  Code:for z = 0 to winMain.Listbox1.ListCount-1 //the minus one because the 
listbox is zero based
  'MsgBox str(winMain.Listbox1.ListCount)
  mibarray(z) = winMain.Listbox1.cell(z,1)
  next z

and it fills in just fine!

So it has nothing to do with the variable; it appears to be the name.

Changing the name to

  Code:for z = 0 to winMain.Listbox1.ListCount-1 //the minus one because the 
listbox is zero based
  'MsgBox str(winMain.Listbox1.ListCount)
  banana(z) = winMain.Listbox1.cell(z,1)
  next z

gives the same error...

Can anyone tell me why? 
Regards   
                             Top                 mjh          Post subject: Re: 
something strangePosted: Thu Jun 10, 2010 10:19 am                         
Joined: Sun Feb 19, 2006 3:10 pm
Posts: 762
Location: Hamburg, Germany                How are mibarray, mibarray2, and 
banana declared?      
_________________
Michael J. Hußmann 
http://digicam-experts.de  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 2 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to