>>>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.
>
>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.
Dragan, I think you're mixing us up here. If SET UDFPARMS is set to VALUE and a variable holding an object reference is sent as a parameter in a normal way, then that variable cannot be changed in the called function/procedure/method. If the setting is REFERENCE, then the variable can be changed. I think your usage of 'passed by reference' obfuscates things here.
Groet,
Peter de Valença
Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.