Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Oct 22, 2018 2:18 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: how to refer to the index of an object
PostPosted: Sat Dec 29, 2012 7:05 pm 
Offline

Joined: Sat Dec 29, 2012 6:56 pm
Posts: 2
This is going to be the biggest newbie question ever, but I just started!

In VB, if I had an array of controls, like a combo box, I could fill them all in a loop like this:

for n = 0 to 7
cboBox(n).additem "Monkey"
cboBox(n).additem "Wrench"
next n

But when I try this in RealStudio, like this:

For i=0 to 7
popEPAD(i).Addrow "EPAD-TH8-J"
popEPAD(i).Addrow "EPAD-TH8-K"
popEPAD(i).Addrow "EPAD-TH8-T"
popEPAD(i).Addrow "EPAD-TH8-C"
popEPAD(i).Addrow "EPAD-TH8-U"
popEPAD(i).Addrow "EPAD-V8"
popEPAD(i).Addrow "EPAD-LA8"
Next

I just get an error "this method requires fewer parameters than were passed," so obviously my (i) with the index in it is failing.
But how can I refer to these 8 arrayed objects? I just don't know the proper syntax.

Thanks!


Top
 Profile  
Reply with quote  
 Post subject: Re: how to refer to the index of an object
PostPosted: Sat Dec 29, 2012 7:36 pm 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
popEPAD must be a control array: http://docs.realsoftware.com/index.php/ ... On_The_Fly

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: how to refer to the index of an object
PostPosted: Sun Dec 30, 2012 6:06 am 
Offline

Joined: Mon Aug 14, 2006 9:33 pm
Posts: 1774
It's a bit hard to discern your intentions, but I guess you are trying to add 7 items to popEPAD which is a popupMenu? If so, there is no need for the loop and you should dispense with the index.
popEPAD.Addrow "EPAD-TH8-J"
popEPAD.Addrow "EPAD-TH8-K"
popEPAD.Addrow "EPAD-TH8-T"
Etc.

_________________
Roger Clary
Class One Software
Educational Software for Lifelong Learning
http://www.classonesoftware.com


Top
 Profile  
Reply with quote  
 Post subject: Re: how to refer to the index of an object
PostPosted: Sun Dec 30, 2012 8:07 am 
Offline

Joined: Sat Dec 29, 2012 6:56 pm
Posts: 2
thanks - i figured out my control group for...next loop issue.
:wink:


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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