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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Classes and variables

Status
Not open for further replies.

radiostar

Programmer
Feb 23, 2004
14
AU
Hi all,

I'm having a bit of trouble trying to work out the correct syntax when setting dynamic variables based on classes. My class is called PIMAppt. This is a simplified version of my code.

The following works -
var NewAppt0:pIMAppt = new PIMAppt ("value1", "value2", etc);

However I want to make the number in the name dynamic (NewApptX).

I've tried this in a for loop but it doesn't work -
this["var " + "NewAppt" + i + ":pIMAppt"] = new PIMAppt ("value1", "value2", etc);

Is there another way to setup the left handside of the argument? Any suggestions would be really appreciated.

Cheers,
RadioStar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top