VB programming array beginner

  • Thread starter debwaldy
  • Start date
  • #1
38
0

Main Question or Discussion Point

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
2019 Award
16,095
6,089
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

Related Threads on VB programming array beginner

  • Last Post
Replies
3
Views
2K
Replies
14
Views
9K
  • Last Post
Replies
2
Views
1K
  • Last Post
Replies
4
Views
4K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
17
Views
2K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
7
Views
2K
Top