On May 3, 2006, at 6:39 PM, Jason Essington wrote:

if it is not byref, then it is fine to pass an array of apples to a method that wants an array of fruit, the same way it is fine to pass an apple to a method that has a fruit parameter.

Since REALbasic 5.5 (IIRC), it has been possible to pass an array typed of Orange to a method that takes Fruit. One Insert and Append, it will then do an extra IsA check against the original type, to ensure that the type is valid for the original array type. If not, you will get a TypeMismatchException.

An array variable is a reference to the actual array. Thus, when you pass an array to a method, you will not be copying the entire array, just a reference. This is the same way as with Strings and Objects. Similarly, if you pass the array ByRef, you can overwrite the array parameter with a new array, and the parent method will balk at the call. This is the same as with strings and objects, again.

HTH,
Jon


--
Jonathan Johnson
REAL Software, Inc.

_______________________________________________
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>

Reply via email to