I dont think you can name a variable at run time, I think you need it
predefined in the code.
That said, why do you want to use 100 different variables instead of an
array with 100 members? An array is usually by far the cleanest way to do
this, what is pecial about this situation that you want 100 different
variables floating about?
[quoted text, click to view] <wandoledzep@hotmail.com> wrote in message
news:1130865668.846954.125610@g49g2000cwa.googlegroups.com...
> But I don't want to create an array--I want to create ten different
> Boolean variables (ex. bol1, bol2, bol3, bol4, bol5, bol6, etc.) using
> a For Next loop. I want to figure this out because if I have to declare
> 100 different variables all the same except with different numbers, why
> can't I use some kind of loop?
>
>
> M. Posseth wrote:
> > you can dynamicly create an array of anny type like this
> >
> > Dim items As Integer = 10
> > Dim bolSquare(items) As Boolean
> >
> >
> > MsgBox(bolSquare(1))
> > MsgBox(bolSquare(2))
> > MsgBox(bolSquare(3))
> >
> > etc etc
> >
> > so in items you can put the required numeber of items
> >
> > isn`t that not much easier and cleaner code ?
> >
> > regards
> >
> > Michel Posseth [MCP]
> >
> >
> >
> > "wandoledzep@hotmail.com" wrote:
> >
> > > I'm using Visual Studio .NET 2002
> > > I remember there was a way to do this in C, so there should be a way
of
> > > doing it in .NET:
> > >
> > > Instead of:
> > >
> > > Dim bolSquare1 as Boolean
> > > Dim bolSquare2 as Boolean
> > > Dim bolSquare3 as Boolean
> > > |
> > > |
> > > |
> > > Dim bolSquare9 as Boolean
> > >
> > > Is there some way of doing it like this:
> > >
> > > Dim i as Integer
> > > For i = 1 to 9
> > > Dim bolSquare(i) as Boolean
> > > Next
> > >
> > > Any help is MUCH appreciated.
> > >
> > > Peace,
> > > LedZep
> > >
> > >
>