Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a counter to call a different var...Enumeration? 1

Status
Not open for further replies.

kstargold

Programmer
Jun 7, 2004
27
0
0
US
I'm not sure if it's call enumeration or not.

It is very simple and goes like this...(this syntax is wrong)

Code:
var myNumber = 7;
var a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;

a[myNumber] = 10;  //what is the format for this function



It combines the "a" and the varable myNumber, alowing the value 10 to store into a7.

What is the syntax for this call??

Thanks,
Kstar





 
Ya probably think about "evaluation":
Code:
eval ( "a"+myNumber +"= 10" );
It is sometimes useful, but don't overdo it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top