>>>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.
This is true for any variable - but what is a content of an object reference variable? The reference to an object. And even if you have a copy of such a variable (i.e. passed by value), it only increases the reference count in the object, it doesn't create a copy of the object. So, substantially, an object passed as a parameter is always passed by reference. Or, more precisely, it's passed as a reference.
You can check this yourself - pass thisform by value to any piece of code which will change its caption and see what happens.