Yourt controls should be in an arry too..

e.g.


create a label, then duplicate it. TheIDE will ask if you want to create an
array. The syntax from then on is simply


label(i).caption = array(i)

I dont think it can be done any oter way. Your example maybe incorrect
because you leave no spaces..

label&i   should be label & i

havent tested this tho.

rnd




----- Original Message ----- 
From: "Skouperd" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 09, 2004 3:06 PM
Subject: [vbhelp] VB Syntax help required.


> Hi everybody, I have a problem and maybe somebody that is smart can
> advise me how to solve it.  I am using VB.net (2003) and the problem
> is something along the following lines.
>
> Sub Test
>  Label1.Text = Array(1)
>  Label2.Text = Array(2)
>  Label3.Text = Array(3)
> ....
>  Label18.Text = Array(18)
>  Label19.Text = Array(19)
>  Label20.Text = Array(20)
> End Sub
>
> Now I need to be able to write the code more or less as follows:
>
> Sub Test2
>  For i = 1 to 20
>   Label&i.text = Array(i)
>  Next i
> End Sub
>
> Now I have listed it EXTREMELY simply above but that is more or less
> what I need to do.  The problem I am having is with the &i (it is
> obviously wrong, but the systax is the one that I use in SAS)  Surely
> VB must be able to support something along the above lines?  Any
> assistance will be appreciated!
>
> Adios
> Skouperd
>
>
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/k7folB/TM
--------------------------------------------------------------------~-> 


'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [EMAIL PROTECTED]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to