>>>
>>>set path to "..\underscore" addititive
>>>oEmpty = CREATEOBJECT("empty")
>>>with _( m.oEmpty )
>>> .return_success = .T.
>>> .string1 = "abc"
>>> .string2 = 123
>>>endwith
>>>
>>
>>Thank you for your input. But why "strongly"? And what is the benefit of getting rid of addproperty?
>
>Because I agree with him :). And you aren't getting rid of it, it's just delegated into the background, where the underscore function (OK, the name isn't its strong point, everything else is) deals with it. The code above looks much cleaner than having each name and value wrapped in quotes and a function call.
I agree that "normal" property assign looks nicer and is easier to understand, and as long as it is not overused to be the backbone of a fwk (inserting the overhead nearly everywhere) it is an intelligent and elegant approach.
But the specific "with" functionality has bitten a few stalwarts - me included. I have "only" witnessed type changes of return value not expected on source - others cited other reasons to be wary of "with .. endwith"
Local var to the rescue (and still prettier IMO)