|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
My problem is that i have a text file that has some info on names, numbers, schools, and scores, all seperated by a tab. What ineed to do is open that file and save it into each seperate part into an array.... having problems storing it into an array.... can someone help??? i would be very grateful
|
|
#2
|
|||
|
|||
|
What is your code that's giving you problems? Have you used the debugger?
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
Dim infile As IO.StreamReader
Dim aLine AsString Dim Parts() AsString If IO.File.Exists("Students.txt") Then infile = IO.File.OpenText("Students.txt") DoUntil infile.Peek = -1 aLine = infile.ReadLine() Parts = aLine.Split(vbTab) mIndex = mIndex + 1 ReDimPreserve mStudentRecord(mIndex) mStudentRecord(mIndex).Name = Parts(0) mStudentRecord(mIndex).ID = Parts(1) mStudentRecord(mIndex).School = Parts(3) mStudentRecord(mIndex).Score = Parts(4) Loop infile.Close() Else MessageBox.Show("File does not exist") EndIf sw = IO.File.AppendText("Students.txt") For k = 0 To mIndex Step 1 sw = WriteLine(mStudentRecord(k).Name & vbTab & mStudentRecord(k).ID & vbTab & mStudentRecord(k).School & vbTab & mStudentRecord(k).Score) Next sw.Close() basically im having trouble taking whats in the file and putting it into an array, i am then going to be writing more to the array and file from textboxes on the form. thanks for any help, let me know if i should attach a zip file of it |
|
#4
|
|||
|
|||
|
Quote:
You would be better off creating a database to store the information then pull the info from the db, This gives you more flexability in your code then you won't need the array. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > help with files and arrays??? please help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|