473,473 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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:
currguess=guesses(x)
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
nj********@hotmail.com
http://www.nathansokalski.com/
Apr 30 '06 #1
2 4550
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)

Next

--
-iwdu15
Apr 30 '06 #2
hello,

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.

cheers.

Apr 30 '06 #3

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

Similar topics

2
by: John Pastrovick | last post by:
Sort of sizeof but applied to a particular array dimension. Similar to ASP ubound(array,dimension)
2
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" $array='FR"
3
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 contains elements or members that are aggregates...
9
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 pull in each line, split it according to the comma...
3
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 multidimensional string array. I do not wish to use a...
38
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*) calloc( ??MAX?? , sizeof(char) ) ; I've...
2
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 Part_Buffer(char (*buffer),int Low, int High)
152
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--) printf("%f\n", *p++); } int main(void) { double array = { {...
9
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 this In the .h file int *x; in a initialize...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.