Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do access data in a 2-dimensional array?

Posted on 2013-12-11
2
Medium Priority
?
207 Views
Last Modified: 2013-12-11
I have a 2-dimensional array that I built. For some reason, I can't remember how to extract the data from it using a For Loop. Here is what I have, which doesn't make sense to me because it appears that I'm doing the same thing twice.

    Dim strData As String = ""

    For x As Integer = 0 to arrLoadTest.Length - 1
        For y As Integer = 0 to arrLoadTest.Length - 1
            strData = arrLoadTest(x, y)
        Next
    Next
0
Comment
Question by:BlakeMcKenna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 64

Accepted Solution

by:
Fernando Soto earned 2000 total points
ID: 39711862
That is correct. While the first loop x goes from o to the end of the first index the second loop y is going through the second index in like manner. So that it accesses the array as follows:

arrLoadTest(0,0),  arrLoadTest(0,1), ..., arrLoadTest(0,n)
arrLoadTest(1,0),  arrLoadTest(1,1), ..., arrLoadTest(1,n)
...
arrLoadTest(m,0),  arrLoadTest(m,1), ..., arrLoadTest(m,n)
0
 

Author Closing Comment

by:BlakeMcKenna
ID: 39711919
Ok, after I thought it through it made sense. The array was based off of a DataGridView (the number of rows and columns) so I just stored those values into variables and used those variables as the indexes.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question