472,341 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,341 software developers and data experts.

Accessing one dimension of a multidimensional array

I have a multidimensional array declared as the following:
Dim guesses(14, 5) As Integer
I want to assign all values in a specific dimension to another array
declared as follows:
Dim currguess(5) As Integer
I would have thought this would be done using something like the following
where x is the dimension I want to copy:
However, VB.NET does not seem to like this. What can I do to copy only a
specific dimension to another array? Thanks.
Nathan Sokalski
Apr 30 '06 #1
2 4475
youd need to put it in a for loop and do it manually

Dim guesses(14, 5) as integer
Dim currGuess(5) as integer

for x as Integer = 0 to 5

currGuesses(x) = guesses(3,X)


Apr 30 '06 #2

do you realize, if you're copying the last dimension, that is
practically all the values in the entire array (think of it as a
relational database where the second dimension is sub/child table
related to the parent table which would be the first dimension), if
you're refering to an array of arrays, that is different ie:

dim arrayOfArrays()() as integer

Here the where the last dimension is all integers, and the first
dimension is of type "Array" ie: ( "TypeOf arrayOfArrays(0) Is Array"
would be true and "TypeOf arrayOfArrays(0)(0) Is Integer" would also be
true, of course given arrayOfArrays are initialized).

of course, if you are just trying to copy the first dimension, or any
dimension except the last one, then that would make sense. looping it
would do, however, for efficiency purposes you should always try to use
microsofts implementations which apply to objects of type Array.

I believe they have various methods, but to make use of these you would
need to create an array of arrays, and just access the objects
following your array like this...

arrayOfArrays(3). [and this is where the intellisense will help you
with more information, since this is an Array object, you'll get all
the mass data manipulation methods available]

hope that helps, let me know if you would like further clarification.


Apr 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: John Pastrovick | last post by:
Sort of sizeof but applied to a particular array dimension. Similar to ASP ubound(array,dimension)
by: markus | last post by:
I usually store info in arrays using field names $array='Germany', $array="GE"; $array='United Sates" $array="US"; $array='France"...
by: Eric Laberge | last post by:
Aloha! I've been reading the standard (May '05 draft, actually) and stumbled across this: 6.7.1 Initialization 20 "If the aggregate or union...
by: Steve Wasser | last post by:
I need to sort a two-dimensional array. Each day I process a file with 9 comma-delimited fields, and varying amount of records (lines). I want to...
by: Jan Hanssen | last post by:
Hi! I have a list of data in a textfile which is tab delimited. Each line is seperated by a VbCrLf. I want to collect this data in a...
by: djhulme | last post by:
Hi, I'm using GCC. Please could you tell me, what is the maximum number of array elements that I can create in C, i.e. char* anArray = (char*)...
by: ...vagrahb | last post by:
I am having accessing individual rows from a multidimensional array pass to a function as reference CODE: function Declaration int...
by: vippstar | last post by:
The subject might be misleading. Regardless, is this code valid: #include <stdio.h> void f(double *p, size_t size) { while(size--)...
by: Slain | last post by:
I need to convert a an array to a multidimensional one. Since I need to wrok with existing code, I need to modify a declaration which looks like...
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.