
vb中输入超出文件尾怎么办
PrivateSubForm_Load()Form1.HideForm3.ShowText1.Text=""DimsAsStringDimiAsIntegerOpen"附...
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 展开
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 展开
2015-06-22
展开全部
附件1-原始成绩.txt 内容不够a, b, c, d, e, f, g这7个变量存储
比如文本文件只有6个数据 你要这7个变量读取 就会出现这错误 检查txt内容格式
比如文本文件只有6个数据 你要这7个变量读取 就会出现这错误 检查txt内容格式
追问
txt文件中大概是这样的 ,请问应该怎么改呢 ?
学号,姓名,性别,高等数学,计算机,英语,大学语文
13096314,王琛,女,87,100,96,100
13096324,孙毅磊,男,68,100,90,100
13616105,张梦兰,女,87,60,68,100
13616131,王俊超,男,75,80,66,100
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询