VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 300,369 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,437 people online right now. Registration is fast and FREE... Join Now!




column elements to structure.member

 

column elements to structure.member

arrayJ

2 Jul, 2009 - 01:05 PM
Post #1

New D.I.C Head
*

Joined: 22 Jun, 2009
Posts: 1

Greetings all!!

I'm having trouble finding whether or not I can assign each element of a column (2-dimension array) to a specific member of a structure.

For example, I have set up a two-dimensional array (16 rows, 3 columns). Each column is a different language, and so far i was planning on running a for loop that would assign each of the 16 words(rows) per each of the 3 languages(columns) and haven't found either the proper syntax or whether it is even possible.

In a separate sub I've filled the 2-D array(tr(15,2). Below is the declared structure and incomplete FOR...NEXT.

Thanks.....ArrayJ
Example:
CODE
Dim tr(15, 2) As String
    Structure lang
        Dim eng() As String
        Dim frn() As String
        Dim ger() As String
    End Structure
    Dim lang1 As lang
    Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblFrench.Click

    End Sub

    Private Sub btnTranslate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTranslate.Click
        For row As Integer = 0 To 15
            lang1.eng = tr(row, 0)


        Next


Ahhh..... quick edit!

Maybe I shouldn't be so quick to ask next time.

It seems I forgot to add "()" to member.

(ie...)
CODE
For row As Integer = 0 To 15
            lang1.eng(row) = tr(row, 0)
            lang1.frn(row) = tr(row, 1)
            lang1.ger(row) = tr(row, 2)

        Next


This post has been edited by arrayJ: 2 Jul, 2009 - 01:45 PM

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 09:02PM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month