diff --git a/TSLInterp.dll b/TSLInterp.dll index aee1497..6d9939b 100644 Binary files a/TSLInterp.dll and b/TSLInterp.dll differ diff --git a/designer/udesignerproject.tsf b/designer/udesignerproject.tsf index 678c6b5..21809d5 100644 --- a/designer/udesignerproject.tsf +++ b/designer/udesignerproject.tsf @@ -3122,6 +3122,7 @@ r := format(%% type %s=class(tdcreateform) ci := self.classinfo(); //将成员变量赋值为nil避免循环引用 for i,v in ci["members"] do begin + if v["const"] then continue; if v["static"] then continue; invoke(self,v["name"],nil); end @@ -3151,6 +3152,7 @@ r := format(%% type %s=class(tdcreatepanel) ci := self.classinfo(); for i,v in ci["members"] do begin + if v["const"] then continue; if v["static"] then continue; invoke(self,v["name"],nil); end diff --git a/funcext/tvclib/utslvclauxiliary.tsf b/funcext/tvclib/utslvclauxiliary.tsf index fbe392c..a0ab439 100644 --- a/funcext/tvclib/utslvclauxiliary.tsf +++ b/funcext/tvclib/utslvclauxiliary.tsf @@ -1132,43 +1132,15 @@ end type trefarray = class() //数组成员引用模拟 function create(d); //构造函数 begin - if ifarray(d) or (d is class(trefarray)) then - begin - FData := d; - end else - begin - FData := array(); - end + FData := d; end function mgset(idxs,v); //根据下标设置值 begin - if not ifarray(idxs) then return nil; - if ifarray(FData) then - begin - if ifarrayidx(idxs) then - begin - fsettemp := v; - s := "FData"+formatarrayidx(idxs)+":=fsettemp;"; - r := eval(&(s)); - fsettemp := nil; - return r; - end - return magicsetarray(FData, idxs,v); - end - return FData.mgset(idxs,v); + return domgset(FData,idxs,v); end function mgget(idxs); //根据获得值 begin - if not ifarray(idxs) then return nil; - if ifarray(FData) then - begin - if ifarrayidx(idxs) then - begin - return eval(&("FData"+formatarrayidx(idxs))); - end - return magicgetarray(FData,idxs); - end - return FData.mgget(idxs,v); + return domgget(fdata,idxs); end function operator[0](idx,v); //获取值 begin @@ -1188,10 +1160,46 @@ type trefarray = class() // end published property data read FData write setdata; - private //成员变量 - FData; - fsettemp; - private + protected + function setdata(d);virtual; + begin + if FData<>d then + begin + FData := d; + return true; + end + end + function domgget(d,idxs);virtual; //根据获得值 + begin + if not ifarray(idxs) then return nil; + if ifarray(d) then + begin + if ifarrayidx(idxs) then + begin + return eval(&("d"+formatarrayidx(idxs))); + end + return magicgetarray(d,idxs); + end + if d is class(trefarray) then return d.mgget(idxs,v); + end + function domgset(d,idxs,v);virtual; //根据下标设置值 + begin + if not ifarray(idxs) then return nil; + if ifarray(d) then + begin + if ifarrayidx(idxs) then + begin + fsettemp := v; + s := "d"+formatarrayidx(idxs)+":=fsettemp;"; + r := eval(&(s)); + fsettemp := nil; + return r; + end + return magicsetarray(d, idxs,v); + end + if d is class(trefarray) then return d.mgset(idxs,v); + return nil; + end function ifarrayidx(idx); begin for i,v in idx do @@ -1215,13 +1223,11 @@ type trefarray = class() // r+="]"; return r; end - function setdata(d); - begin - if FData<>d and ifarray(d) then - begin - FData := d; - end - end + FData; //原始数据 + private //成员变量 + fsettemp; + private + private //中间对象 type trefsgter = class() function create(a,idx);