How to assign indexes to variable names? For instance, project0, project1, project2, etc?
for (var i=0; i<data.length; i++)
{
var project+i = new GanttProjectInfo(1, "Applet redesign", new Date(2010, 5, 11));
var parentTask+i = new GanttTaskInfo(1, "Old code review", new Date(2010, 5, 11), 208, 50, "");
project1.addTask(parentTask+i);
// Load data structure
ganttChartControl.addProject(project+i);
// Build control on the page
}
Just as @JaredFarrish suggested, you can simply use an array to store all the projects. Create them and add them to the array before the variable gets overwritten: