Java and Groovy are both "pass-by-value" languages. That is, if you pass a value to a method and the method modifies it, you don't see a change in the calling scope. COM, on the other hand, supports both "pass-by-value" (or "byval") and "pass-by-reference" (or "byref"). When you call a method that accepts a "pass-by-reference" parameter, the method can modify the parameter value, and this will be reflected in the calling scope. Byref argument passing was always a favorite of C/C++ programmers, who often use the result of a method to pass exception information. It was the default way to pass values in versions of Visual Basic through 6. With the advent of modern try/catch exception handling, modifying values inside a method is generally considered bad programming practice. Visual Basic (and COM) still supports byref, but byval is now defined as the default setting. You should not have to deal with byref parameters often. That doesn't mean it will never happen, though. I shouldn't surprise you that Scriptom supports passing parameters by-reference, just in case you need it.
You are viewing an old version of this page. View the current version. Compare with Current · View Page History