|
-
Jan 9th, 2001, 11:01 PM
#1
Thread Starter
PowerPoster
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]
-
Jan 9th, 2001, 11:10 PM
#2
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Jan 9th, 2001, 11:10 PM
#3
Thread Starter
PowerPoster
I'm getting the name on the first line, then a whole bunch of zero's after it.
-
Jan 9th, 2001, 11:12 PM
#4
Thread Starter
PowerPoster
Figured it out, dumb mistake.
-
Jan 9th, 2001, 11:14 PM
#5
uh, well, glad to be of help
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
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
|