22 MakeArray 函数和对象数组 - II
var maxdisplay = 10;
displays = new MakeArray(maxdisplay);
for( var n=1; n <= maxdisplay; n++) {
displays[n] = new Display(n); } // 设 displays 的元素为 Display
“类”的对象
现在我们有了一个长度为 maxdisplay 的 Display 对象组成的数组可以引用 displays[1] ... displays[maxdisplay] , 其特性有
displays[currentdisplay].pageframe; 等
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; } // 重栽 MakeArray
中的初始化
Copyright: NPACT