-
I can't figure out what is wrong with this. It just doesn't print the results that I want:
Here's the text file:
"Mike";
1;
2;
3;
4;
Code:
Option Explicit
Global StudentGrades() As StudentRecord
Type StudentRecord
Name As String
FirstExam As Integer
SecondExam As Integer
ThirdExam As Integer
FourthExam As Integer
End Type
Sub RetrieveGrade()
Dim FileNum As Integer
Dim I As Integer
ReDim StudentGrades(1)
FileNum = FreeFile
Open "c:\Grades.txt" For Input As FileNum
Input #FileNum, StudentGrades(I).Name
Input #FileNum, StudentGrades(I).FirstExam
Input #FileNum, StudentGrades(I).SecondExam
Input #FileNum, StudentGrades(I).ThirdExam
Input #FileNum, StudentGrades(I).FourthExam
Close FileNum
End Sub
Code:
Private Sub Command1_Click()
Dim I As Integer
Call RetrieveGrade
Print StudentGrades(I).Name
Print StudentGrades(I).FirstExam
Print StudentGrades(I).SecondExam
Print StudentGrades(I).ThirdExam
Print StudentGrades(I).FourthExam
End Sub
[Edited by Lethal on 01-09-2001 at 11:07 PM]
-
-
I'm getting the name on the first line, then a whole bunch of zero's after it.
-
Figured it out, dumb mistake.
-
uh, well, glad to be of help