473,419 Members | 1,533 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,419 software developers and data experts.

Creating a multi dimensional array

I need to create a public multi-dim array that can hold a mixture of string
and int values. I will need to search this array for a value and return a
value from a subscript.

This array will expand as it reads in records, so I will need to preserve
the current contents.

For example, I currently do this in Visual Foxpro.

Public laList(1,5)
j=1
select mydataset
scan
dimension myList(j,5) && Resize the array
lcName=mydataset.customername
laList[j,1]=j
laList[j,2]=0123456789
laList[j,3]=lcName
laList[j,4]='Name'
laList[j,5]='1,2'
j=j+1
endscan

When I click on a control on the form, I search the laList array for the
controls value laList[j,5], and read the corresponding laList[j,2] value
which in turns gets another set of data and populates a different control.

How can I accomplish this in VB.Net ???

Thanks.
Nov 23 '05 #1
2 9912
Dino wrote:
I need to create a public multi-dim array that can hold a mixture of string
and int values. I will need to search this array for a value and return a
value from a subscript.

This array will expand as it reads in records, so I will need to preserve
the current contents.

For example, I currently do this in Visual Foxpro.

Public laList(1,5)
j=1
select mydataset
scan
dimension myList(j,5) && Resize the array
lcName=mydataset.customername
laList[j,1]=j
laList[j,2]=0123456789
laList[j,3]=lcName
laList[j,4]='Name'
laList[j,5]='1,2'
j=j+1
endscan

When I click on a control on the form, I search the laList array for the
controls value laList[j,5], and read the corresponding laList[j,2] value
which in turns gets another set of data and populates a different control.

How can I accomplish this in VB.Net ???

Thanks.


Have you thought of doing an array of arraylists?

Arraylists allow you to have multi datatypes associated with it and
allows for expand/contracting.

Dim laList as new arraylist
dim ExpandList as new arraylist
laList.add(ExpandList)

Chris
Nov 23 '05 #2
"Dino" <Di**@discussions.microsoft.com> schrieb:
I need to create a public multi-dim array that can hold a mixture of string
and int values. I will need to search this array for a value and return a
value from a subscript.


Check out the documentation for VB.NET's 'Dim' and 'ReDim' statements.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #3

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

Similar topics

2
by: ip4ram | last post by:
I used to work with C and have a set of libraries which allocate multi-dimensional arrays(2 and 3) with single malloc call. data_type **myarray =...
5
by: Cant Think Today | last post by:
I have multi-dimesional arrays that can be specifed by the user, e.g 1,2,3,4,5 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6 I think a bit of code that will iterate over these arrays to print out the...
5
by: Andrew Poulos | last post by:
If I'm searching for an occurance of a value in a multi-dimensional array how can I get it's index returned as an array, if found? For example, if: foo = new Array(); foo = , 5, , 9, 10]; ...
4
by: Robert P. | last post by:
I can easily store a one-dimensional array in viewstate ( see Test1 ) If I try storing a multi-dimensional array in the viewstate it's crapping out on me when it goes to serialize the array (not...
3
by: SQLScott | last post by:
I have looked all over and I cannot find an example or information on passing a multi-dimensional array. Well, that is not true. I found a close example in C++ but it didn't work when I...
4
by: Balaskas Evaggelos | last post by:
Hi, does anyone know how i can sort a multi-dimensional array by a specific field ? for example i want to sort arr where n=2, but i need the data of every array to follow that order. ...
8
by: per9000 | last post by:
Hi all, I have a two-dimensional array of data, f.x int's. We can imagine that the array is "really large". Now I want the data in it and store this in a one-dimensional array. The obvious...
3
by: gihope | last post by:
Can anyone tell me why I am not allowed to bind a two or multi dimensional array to GridView and possibly suggest how they would deal with similar scenarios? The array is simply a two dimensional...
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 = { {...
4
by: =?Utf-8?B?SGVucmlrIFNjaG1pZA==?= | last post by:
Hi, consider the attached code. Serializing the multi-dimensional array takes about 36s vs. 0.36s for the single-dimensional array. Initializing the multi-dimensional array takes about 4s...
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: 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
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,...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.