473,396 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Array.Copy and Multi-dimensional arrays...

I have a requirement to search a multi-dimensional array for an item, then
delete the item and "reset" the array so that their are no gaps in the
resulting array. I have been trying to figure out how to use the Array.Copy
method to accomplish this but it seems to only work for single dimension
arrays. Here is a code sample:

'dim arrTest(600,3) as string 'Actual array dimension needed
dim arrTest(600) as string 'Used only in this test
dim intIndex as Integer
dim randomNum as New Random()

'Get random index into array for delete test
intIndex = random.Next(0, UBound(arrTest))

'Shifts elements from arrTest(intIndex + 1) to arrTest(intIndex)
Array.Copy(arrTest, intIndex + 1, arrTest, intIndex, UBound(arrTest) - 1)

'Clears the last element
arrTest.Clear(arrTest, arrTest.GetUpperBound(0), 1)

Any idea on how to modify this code or let me know a better approach to
doing this for a multidimensional array?

Thanks in advance.
Jul 21 '05 #1
0 1027

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

Similar topics

58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
8
by: Levent | last post by:
Hi, Is it possible to have static multi-dim array as a function return parameter? in particular, class Foo { int arr; public: ? getArr() {return (?) arr;}
1
by: herrcho | last post by:
#include <stdio.h> int multi; int main() { printf("\nmulti = %u",multi); printf("\nmulti = %u",multi); printf("\n&multi = %u\n",&multi); return 0;
15
by: Kueishiong Tu | last post by:
How do I copy the content of a string in one encoding (in my case big5) to a char array (unmanaged) of the same encoding? I try the following String line = S"123æ°´æ³¥"; char buffer; ...
8
by: luis molina Micasoft | last post by:
it seems that when i do file.copy the svchost.exe is hanged, i mean if i make 40 threads of file.copy , 40 copys of files at same time the system is going down and stop responding, this is when i'm...
9
by: Phil Jones | last post by:
If I have an array of 's, all of the same type (say for example). Is there a quick way to cast that to a typed String array? Presently I'm having to copy each object to a new array. I'm...
2
by: lgbjr | last post by:
Hi All, Is there a way to sort multiple dimensions of an array in VB.NET? Let's say I have the following in a multi-dimension array: 3081 100 2 3081 100 1 3081 20 1 3081 1 2 3021 100 2
1
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
Using .NET 2.0 is it more efficient to copy files to a single folder versus spreading them across multiple folders. For instance if we have 100,000 files to be copied, Do we copy all of them to...
10
by: abhash | last post by:
I am bit puzzled at the following piece of code I tried: ---------------------------------------------------------------------------------- #include <iostream> using namespace std; class Test...
1
rahulephp
by: rahulephp | last post by:
I want to print array something like this level1 level2 Who we are . Welcome from jay(video) . mission statement (Copy) . vision(Copy) . what we believe(copy) . FAQ (copy)
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.