Text File Input Help *please help me*
I am trying to make a basic math program for an assignment. At the end of the sums it saves the details into a into a text file. The next form shows a summary page that reads the data. However it will not read any "/" or ",".
The text file data is as follows:
7/08/2007,0,30,3
What i want it to do, is that it will read all the data UNTIL if finds the "," the data is then to go into the textbox, then continue reading after the "," until it finds the next "," and do this until the end of the file
I no this can be done, but its beyond what i no, and i need help. You help will be greatly appreciated because it is due soon.
Thanks
Fen
Re: Text File Input Help *please help me*
Post what you have and I'm sure people will guide you (rather than do it for you, if you no what I mean)
Re: Text File Input Help *please help me*
ok its:
Code:
Dim textboxnumber As Integer
Do Until a = 3
Input #2, sText
If sText = "," Then
textboxnumber = textboxnumber + 1
End If
Text1(textboxnumber).Text = Text1(textboxnumber).Text & sText
a = a + 1
Loop
Re: Text File Input Help *please help me*
Quote:
Originally Posted by feneck
ok its:
Code:
Dim textboxnumber As Integer
Do Until a = 3
Input #2, sText
If sText = "," Then
textboxnumber = textboxnumber + 1
End If
Text1(textboxnumber).Text = Text1(textboxnumber).Text & sText
a = a + 1
Loop
mayb you can try use the Split function.
i help you do some modification, try to have a look
Code:
Dim FileNumber As Integer, i As Integer
Dim TempStr
Dim sText As String
FileNumber = FreeFile
Do While Not EOF(FileNumber)
Line Input #FileNumber, sText
Loop
Close #FileNumber
TempStr = Split(sText, ",")
For i = LBound(TempStr) To UBound(TempStr)
Text1(i).Text = Text1(i).Text & TempStr(i)
Next