THIS IS DONE WITH! PROCEED TO NEWER POSTS FOR OTHER CASES! =P
HELP HERE NOW!http://www.neogaf.com/forum/showpost.php?p=33403845&postcount=73
OLD
http://www.neogaf.com/forum/showpost.php?p=32112694&postcount=67
I fought hard to avoid making one of these this semester, but as part of my programming course I am to do a final program that has to do the following:
1. Define a structure
2. Define an array equal to this structure (aka... a matrix).
I am ok until here...
The third requirement is forcing me to Open a text file and read from it. Cool, I know how to do that process... NOW.....
"Read the rates data from a text file and store it in
the array.
This code must be executed only once
during program execution.
1)
Use an Open File Dialog control to get the name
and location of the text file."
I have NO idea how to do this. Text book doesn't have any solid examples and Google is netting me some hard examples. This is the Sub-procedure code so far:
The last part is basically me testing to see if the string was passed. I am stuck. Any tips?
EDIT: Erm I got it to read the file. :lol :lol Code was fine, I was just trying to pass the string as an Integer and it didn't work. Writing numbers the code worked.
Now my question would primarily be.... how do I read each line of code and add each line of the code to the arrays? I know you can for example separate with commas... but how would I go for the program to read it?
OLD
HELP HERE NOW!http://www.neogaf.com/forum/showpost.php?p=33403845&postcount=73
OLD
http://www.neogaf.com/forum/showpost.php?p=32112694&postcount=67
I fought hard to avoid making one of these this semester, but as part of my programming course I am to do a final program that has to do the following:
1. Define a structure
2. Define an array equal to this structure (aka... a matrix).
I am ok until here...
The third requirement is forcing me to Open a text file and read from it. Cool, I know how to do that process... NOW.....
"Read the rates data from a text file and store it in
the array.
This code must be executed only once
during program execution.
1)
Use an Open File Dialog control to get the name
and location of the text file."
I have NO idea how to do this. Text book doesn't have any solid examples and Google is netting me some hard examples. This is the Sub-procedure code so far:
Dim inputFile As StreamReader
Dim strFilename As String
Dim test As Integer
With ofdOpen
.Filter = "Text Files (.txt)|*.txt|All Files (*.*|*.*"
.Title = "Select File to Open"
If ofdOpen.ShowDialog = Windows.Forms.DialogResult.OK Then
strFilename = ofdOpen.FileName
Try
inputFile = File.OpenText(strFilename)
test = inputFile.ReadToEnd
inputFile.Close()
Catch
MessageBox.Show("No file")
End Try
txttest.Text = CStr(test)
End If
End With
The last part is basically me testing to see if the string was passed. I am stuck. Any tips?
EDIT: Erm I got it to read the file. :lol :lol Code was fine, I was just trying to pass the string as an Integer and it didn't work. Writing numbers the code worked.
Now my question would primarily be.... how do I read each line of code and add each line of the code to the arrays? I know you can for example separate with commas... but how would I go for the program to read it?
OLD