var maxdisplay = 10; |
displays = new MakeArray(maxdisplay); |
for( var n=1; n <= maxdisplay; n++) { |
displays[n] = new Display(n); } // set elements of displays to be objects of "class" Display |
Now we have an array of Display objects of length maxdisplay which can be referenced as displays[1] ... displays[maxdisplay] with properties such as |
displays[currentdisplay].pageframe; etc. |
This can be nested with MakeArray used say inside a function such as Display to get variables referenced like |
displays[currentdisplay].nestedarray[itsindex]; // and so on for more array indices -- this implies we put in Display |
this.nestedindex = new MakeArray (whathaveyou) ; |
for( var n=1; n <= whathaveyou; n++) { |
nestedindex[n] = null; } // Override initialization in MakeArray |