realbasic-nug
[Top] [All Lists]

Re: method parameter as array

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: method parameter as array
From: Tony Alfrey <tonyalfrey@earthlink.net>
Date: Thu, 29 Jan 2009 12:34:51 -0800
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com; domainkeys=hardfail (test mode) header.From=tonyalfrey@earthlink.net
Delivered-to: listarchive@realsoftware.com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=K95J2JXESkbpWFmFdBILdOZzjpBitnuRha+jQHRaANw38B+gR/HqES8TGGPVZ5Jv; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-ELNK-Trace:X-Originating-IP;
Domainkey-status: bad (test mode)
In-reply-to: <89fe53800901291212g2f22e942v2b368b88ae1d5459@mail.gmail.com>
References: <49820316.6090503@earthlink.net> <89fe53800901291133i3e8f2278t2c91ca5e30a0e077@mail.gmail.com> <49820677.5050605@earthlink.net> <4982092F.7060407@earthlink.net> <89fe53800901291212g2f22e942v2b368b88ae1d5459@mail.gmail.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)
Thomas Tempelmann wrote:
Where does the array get dimensioned, in other words, at what point does
memory get allocated?  I suppose maybe it is allocated when the array is
dimensioned in the code that calls the method?
And if this is the case, it sounds like that the array must be
re-dimensioned prior to calling the method?

It gets allocated when you declare the _variable_, i.e. in:

dim a(10,10) as double

Then, when you pass this to your subroutine, only a _reference_ to
this variable is passed, just as if the array were an object. This
allows the subroutine to even modify the array (or resize it using the
"redim" statement).

Very powerful. That makes it very easy to move this Fortran code to realBasic. I have to change almost nothing.

Thanks



--
Tony Alfrey
tonyalfrey@earthlink.net
"I'd Rather Be Sailing"

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>