By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,275 Members | 920 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,275 IT Pros & Developers. It's quick & easy.

How can I extract a row of data from a 2 dimensional array

P: n/a
Seems a simple question, but I can't find a simple answer:

I have created a two dimensional array. I wish to send the data, a row at a time to a graph plotting routine which is expected a one dimension array.

I could create a temporary one dimensional array and populate from the original array and then pass it to the routine, but this would seem to be long winded (read slow), and may well give me problems, as the previous values in the temporary table are overwritten.

Is there a simple way to create a one dimensional array from a single row of a two dimensional array?

Many Thanks

Smurf
Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hey Smurf,

I'm not too sure there is a simpler way to go from two-dimensional to one
than what you mentioned. Is there any possibility of using a jagged array
instead of a 2-dim? You could then pass just that element.

You _MIGHT_ find it quicker to create a 2-dim that only has one row then use
the Array.Copy() or the CopyTo() methods to duplicate the desired section,
though it's not really a 1-dim now so may not work either.

Good luck,

John

"smurf" <sm***@discussions.microsoft.com> wrote in message
news:7F**********************************@microsof t.com...
Seems a simple question, but I can't find a simple answer:

I have created a two dimensional array. I wish to send the data, a row at a time to a graph plotting routine which is expected a one dimension array.
I could create a temporary one dimensional array and populate from the original array and then pass it to the routine, but this would seem to be
long winded (read slow), and may well give me problems, as the previous
values in the temporary table are overwritten.
Is there a simple way to create a one dimensional array from a single row of a two dimensional array?
Many Thanks

Smurf

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.