On May 31, 2005, at 7:45 AM, Robert Woodhead wrote:
it actually gets passed by reference!
This is not good. It's either a bug, or if it is intended that
byval not work with arrays, then it needs to be redlined in the
documentation in 48pt font that it doesn't!
No, "it" gets passed ByVal, which is the default for all argument
passing unless you say ByRef. Where I think you might be confused is
what exactly what "it" is. For objects, and arrays act like objects
when passed as arguments, what gets passed is a *reference* to the
array. And it is that reference that is passed by value. Which means
that if you assign a new array to the argument in the method, like
this (assuming aArray is an array of Integers):
aArray = Array(1, 2, 3)
The caller's array will be unchanged. If, on the other hand, you
declare aArray to be ByRef, then the above line of code would change
aArray for the caller as well.
--
REALbasic database options: http://sqlabs.net
REALbasic news and tips: http://rbgazette.com
KidzMail & KidzLog: http://haranbanjo.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|