|
-
Aug 6th, 2007, 08:44 PM
#1
Thread Starter
Lively Member
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
-
Aug 6th, 2007, 09:07 PM
#2
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)
-
Aug 6th, 2007, 09:30 PM
#3
Thread Starter
Lively Member
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
-
Aug 6th, 2007, 10:18 PM
#4
Addicted Member
Re: Text File Input Help *please help me*
 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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|