>    I have an embarrassing question that I should know the 
> answer too but my memory is waaaay faulty today. Below is a 
> code snippet, what I'm trying to do is access a global 
> variable to use it's value for something in a function but 
> part of the variable name is being sent as a parameter, it's 
> a number from 1 to 10. So the code below for example should 
> be accessing this
> 
> Global gStandard1DataRef
> 
>    If I use
> 
> LoadDataSet 1
> 
> Here's my faulty code
> 
> on LoadDataSet stdnum
>   Global "gStandard"&stdnum&"DataRef"
> End

There may be a way to construct a variable name on the fly, like you can
in Flash, but I'm not certain if/how it's done.

I would make the variable a list and access it by list reference.
Something like:

on LoadDataSet stdnum
  Global glStandardDataRef
  return glStandardDataRef.getAt(stdnum)
End

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/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