DEFINE CLASS RatFace AS Custom nTtest= SECONDS() ENDDEFINEIf you instance many objects of class Ratface, all will have the same nTest property. If on the other hand you do this
DEFINE CLASS RatFace AS Custom Ntest= 0 FUNCTION INIT This.ntest= SECONDS() ENDDEFINEThen each instance gets its own nTest value, as you would expect.
> >local lo >clear >lo= createobject('cascader') >lo.changex() >lo.showx() >lo = '' > >define class cascader as container > iMax = 4 > function init > local i > for i = 1 to this.iMax > this.addobject('c'+transform(i),'cobj',i) > endfor > endfunc > > function changex > set step on > this.c1.x = 2 > > function showx > local lxobj, i > for i = 1 to 4 > lxobj = evaluate('this.c'+transform(i)) > ? 'this.c'+ transform(i) +'.x = ' + transform(lxobj.x) > endfor > >enddefine > >define class cObj as custom > x = 0 > i = 0 > > function init > lpara tni > this.i = tni > endfunc > > function x_assign > lparameters txVal > local lxobj > this.x= txVal > if this.i < this.parent.iMax > lxobj = evaluate('this.parent.c'+transform(this.i+1)) > lxobj = lxobj.x + (2 * this.x) > endif > >enddefine >>