realbasic-nug
[Top] [All Lists]

Re: Possible to extract dimensions of values from an array?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Possible to extract dimensions of values from an array?
From: "Joseph J. Strout" <joe at strout dot net>
Date: Tue, 28 Feb 2006 09:17:17 -0600
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <F8E6412C-8235-47B2-BFD1-1402BECC3BE3 at mac dot com>
At 9:56 PM -0500 2/27/06, Dave Crist wrote:

If you have a 2-D array and address it like myArray[0][3], for example, you would get a single value back...

However, if you would like a reference to all of the values from a single row... you can ask Java for just myArray[0] and you would get back a one-D array representing all of the values for that row...

What if you want a single column?

Does RB have the equivalent, by chance?... :) I can't seem to find a reference to it in the Help or the UG... but I'm pretty stupid.

No; a 2D array in REALbasic is a true 2D array, not an array of 1D arrays, as it is in C and Java. So you could make a slice method like this, but it'd have to actually copy the values.

Best,
- Joe

--

Joseph J. Strout
joe at strout dot net
_______________________________________________
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>


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