> > Anybody know if I can concatenate variable names like strings? I have a
> > large number of variables (ball1, ball2, ball3 etc) and am trying to
> > optimise my code. I can set a temp variable to a number (eg
> x=1, x=2 etc)
> > and want to create the 1st variable from this.
> >
> > eg
> >
> > (ball&x)
> >
> > to get ball1, ball2, ball3 etc, depending on the value of x. At
> the moment

>
> I don't think what you're trying to do will work (ok so some things aren't
> possible in lingo ;)
>
> but why not simply use a list?
>
> ball[x]
>
> Rich

Hi,

Yes it is possible. It is not very efficient, but if you are only doing it
once to set the globals up then it should be okay. On the other hand the
suggestion of a list sounds altoegther better to me :)

You do it like this (taken fromn the message window in D7):

z = "Ball" & 1

do "global" && z && RETURN && z && " = 123"

put Ball1
-- 123

Cheers
Owen


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to