VB programming array beginner

  • Thread starter debwaldy
  • Start date
  • #1
debwaldy
38
0
Hi im a new-comer to VB.Net & im working with arrays at the moment.i want to write a procedure that accepts two 2-D arrays(max size being a 4*4 matrix).
i dont know how i could get the procedure to read in these values from the sixteen different textboxes i have created....i started using a for/next loop to go through each row as shown below:

Dim i, j, n, m As Integer
Dim a As Double(,)
a = New Double(i, j) {}
For i = 0 To a.GetUpperBound(i)
For j = 0 To a.GetUpperBound(j)
a(i, j) = TextBox

its here that im stuck i want it to go through each row of textboxes row by row and read in the values input by the user.would some sort of inner loop again work...or is there a much easier way to do this...any help is much appreciated :biggrin:
 

Answers and Replies

  • #2
phinds
Science Advisor
Insights Author
Gold Member
2021 Award
17,920
10,147
Hi im a new-comer to VB.Net & im working with arrays at the moment.i want to write a procedure that accepts two 2-D arrays(max size being a 4*4 matrix).
i dont know how i could get the procedure to read in these values from the sixteen different textboxes i have created....i started using a for/next loop to go through each row as shown below:

Dim i, j, n, m As Integer
Dim a As Double(,)
a = New Double(i, j) {}
For i = 0 To a.GetUpperBound(i)
For j = 0 To a.GetUpperBound(j)
a(i, j) = TextBox

its here that im stuck i want it to go through each row of textboxes row by row and read in the values input by the user.would some sort of inner loop again work...or is there a much easier way to do this...any help is much appreciated :biggrin:
Yeah, this is a frustration w/ VB.NET, after such things (called "control arrays") that were so easy in VB6 got tossed out in VB.NET

There ARE ways to create control arrays in VB.NET but it's quite ugly. I suggest a search on one of the VB.NET forums. The details are just too messy for me to want to go into here in a post.
 
  • Like
Likes Greg Bernhardt

Suggested for: VB programming array beginner

Replies
2
Views
434
Replies
18
Views
610
Replies
9
Views
849
Replies
20
Views
835
  • Last Post
Replies
1
Views
854
  • Last Post
Replies
6
Views
806
  • Last Post
Replies
5
Views
513
  • Last Post
Replies
4
Views
1K
Replies
11
Views
452
  • Last Post
Replies
24
Views
1K
Top