Enniobozzetti
asked on
Structure HELP!!!
I have this sub in my code.
Public Sub get_data(ByRef first() As String, ByRef last() As String, ByRef email() As String)
Dim counter As Integer
'Open the text file so we can read the data into the array
FileOpen(1, "testfile.txt", OpenMode.Input)
counter = 0
tCounter = 0
Do Until (EOF(1))
Input(1, aFname(counter))
Input(1, aLname(counter))
Input(1, aEmail(counter))
counter += 1
tCounter += 1
Loop
FileClose(1)
End Sub
I need to change the arrays to a structure, so I created my structure
Public Structure user_data
Public fName As String
Public lName As String
Public eMail As String
End Structure
Now the input you need to pass the file number, and a ByRef Value as an Object what should I use? I tried to do this but it didn't work.
Public info_data(25) As user_data
Public Sub get_data(ByRef data_temp As user_data)
but when I ran the software I still don't see any data on my info_data
what I'm trying to do is to read a text file, where I have some information, and store on my structure. When I use array it works, but I need to do with structure.
Public Sub get_data(ByRef first() As String, ByRef last() As String, ByRef email() As String)
Dim counter As Integer
'Open the text file so we can read the data into the array
FileOpen(1, "testfile.txt", OpenMode.Input)
counter = 0
tCounter = 0
Do Until (EOF(1))
Input(1, aFname(counter))
Input(1, aLname(counter))
Input(1, aEmail(counter))
counter += 1
tCounter += 1
Loop
FileClose(1)
End Sub
I need to change the arrays to a structure, so I created my structure
Public Structure user_data
Public fName As String
Public lName As String
Public eMail As String
End Structure
Now the input you need to pass the file number, and a ByRef Value as an Object what should I use? I tried to do this but it didn't work.
Public info_data(25) As user_data
Public Sub get_data(ByRef data_temp As user_data)
but when I ran the software I still don't see any data on my info_data
what I'm trying to do is to read a text file, where I have some information, and store on my structure. When I use array it works, but I need to do with structure.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.