>>You can check this yourself - pass thisform by value to any piece of code which will change its caption and see what happens.
>
>Pass thisform by reference, change its value and see what happens when you use it. See
Re: Find a flaw in the logic Thread #
1086027 Message #
1086509Yes, I ran that code. My point is that it would still operate on Checkbox2, it wouldn't be creating a copy of the checkbox, which would vanish when your code exits (as it happens with variables passed by value).
Again, we're talking about two separate things: my point is that an object variable is a reference to the actual object, regardless of whether it's passed by reference or by value. It doesn't create a copy of the object, it only creates a copy of the reference variable.
And your point, as I understand it, is that such a variable, if passed by reference, can be messed with, be made to point to a different object (as your example shows), be dereferenced etc. Which is also true - but that doesn't do anything to the object the variable referenced in the first place. Did anything happen to checkbox1 in your example?
And I agree about your initial remark to Nadya, there is a potential danger that the object passed may be re-referenced if passed by reference. Though, I've done pretty much the same thing as she did in my recurse class and never had a problem, probably because I didn't need to reuse the object passed after the recursion routine exits.