>>>>Few days ago I had this:
>>>>
FOR i = 1 TO oChild.DataParameters.COUNT
>>>> cPar = oChild.DataParameters.GETKEY(i)
>>>> xVal = oChild.DataParameters.ITEM(i)
>>>>* addproperty(oChild, cpar, xval)
>>>> oChild.ADDPROPERTY(cPar, xVal)
>>>>ENDFOR
>>>>
>>>>This code works as it is now. However, with the commented line used instead of oChild.AddProperty(), it did nothing. The property wasn't added.
>>>>
>>>>Is it that addproperty() function has some cases when it doesn't work? Is it because oChild has its own addProperty() method? I've always thought that addproperty() function can be used on anything that is an object.
>>>
>>>Never heard something like that.
>>>What is the base class of oChild?
>>
>>Session.
>
>This code works both ways:
>
>oChild= CREATEOBJECT("Session")
>oChild.Addproperty([DataParameters],CREATEOBJECT("Collection"))
>FOR lnFor = 1 TO 15
> WITH oChild.DataParameters AS Collection
> .Add(lnFor, SYS(2015))
> ENDWITH
>NEXT
>
>
>FOR lnFor = 1 TO oChild.DataParameters.Count
> cPar = oChild.DataParameters.GETKEY(lnFor)
> xVal = oChild.DataParameters.ITEM(lnFor)
> addproperty(oChild, cpar, xval)
>* oChild.ADDPROPERTY(cPar, xVal)
>NEXT
>
>SET STEP ON
>
>Maybe Yousfi get you the answer?
>:-)
Found it - thanks, guys.
There was a "for each oChild in this.Children" around that code, and help for addproperty() says that it wouldn't work for such references. Perhaps if there was a FOXOBJ added... well, maybe. Mystery solved.