>>>You are right. However, I'm of opinion that you are actually breaking a 'standard rule' here. You are at risk of changing the value of a variable in the calling program. The code should be something like:
>>>
>>>
lparameters tlEnabled, toObject
>>>
>>>local loObjectX
>>>
>>>if vartype( m.toObject ) <> "O"
>>> loObjectX = this
>>>else
>>> loObjectX = m.toObject
>>>endif
>>
>>No risk at all since I'm using lparameters and not passing variable by reference.
>
>Ah, but, as far as I know, objects are
always passed by reference, because the object type variables
are references to actual objects. So if you pass an object by value, you do get a new variable, which still refers to the same object.
You're absolutely right. That again proves that Peter is wrong <g>, since two people can only be right at the same time in Hershelle Ostropoller's stories. <g>
>
>If it wasn't so, your changes to the object would be lost as soon as your code exits - but you know your code works.
If it's not broken, fix it until it is.
My Blog