vb中输入超出文件尾怎么办

Private Sub Form_Load()

Form1.Hide
Form3.Show
Text1.Text = ""
Dim s As String
Dim i As Integer

Open "附件1-原始成绩.txt" For Input As #1
While Not EOF(1)
Input #1, a, b, c, d, e, f, g ( 这里 !!!!!!!!!!)
countA = countA + 1
Wend
Close #1
countA = countA - 1

ReDim xuehao(countA), xingming(countA), xb(countA), yy(countA), jsj(countA), sx(countA), yw(countA), jd(countA)
Open "附件1-原始成绩.txt" For Input As #1
Input #1, a, b, c, d, e, f, g
While Not EOF(1)
i = i + 1
Input #1, xuehao(i), xingming(i), xb(i), yy(i), jsj(i), sx(i), yw(i)
Wend
Close #1
End Sub

附件1-原始成绩.txt 内容不够a, b, c, d, e, f, g这7个变量存储
比如文本文件只有6个数据 你要这7个变量读取 就会出现这错误 检查txt内容格式追问

txt文件中大概是这样的 ,请问应该怎么改呢 ?
学号,姓名,性别,高等数学,计算机,英语,大学语文
13096314,王琛,女,87,100,96,100
13096324,孙毅磊,男,68,100,90,100
13616105,张梦兰,女,87,60,68,100
13616131,王俊超,男,75,80,66,100

温馨提示:答案为网友推荐,仅供参考
相似回答