>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.
I remember some gotchas with array properties. The code looks ok, but I'd code it to make certain all assumptions are met
local....
loPara = oChild.DataParameters
lnEnd = loPara.COUNT
FOR i = 1 TO m.lnEnd
cPar = loPara.GETKEY(i)
xVal = loPara.ITEM(i)
store .f. to llOk, llOkMeth
llOk = addproperty(oChild, cpar, xval)
if ! m.llOk
llOkMeth = oChild.ADDPROPERTY(cPar, xVal)
if ! m.llOkMeth
endif
endif
ENDFOR