主题:vb中write和print的区别
程序中这一句有问题:Print #1, "007", "周星驰", 100。改成write #1, "007", "周星驰", 100就没事,请问这是为什么???
Private Sub Command1_Click()
Open "e:\zhu zhong zhi\scores.dat" For Output As #1
Write #1, "200700103033", "朱中志", 98
Write #1, "200700103001", "袁文登", 88
Print #1, "007", "周星驰", 100
Close #1
End Sub
Private Sub Command2_Click()
Open "e:\zhu zhong zhi\scores.dat" For Input As #1
Dim no, name As String, score As Integer
Dim count, sum As Integer, ave As Single
Do While Not EOF(1)
Input #1, no, name, score
count = count + 1
sum = sum + score
Loop
ave = sum / count
Print ave
Close #1
End Sub
Private Sub Command1_Click()
Open "e:\zhu zhong zhi\scores.dat" For Output As #1
Write #1, "200700103033", "朱中志", 98
Write #1, "200700103001", "袁文登", 88
Print #1, "007", "周星驰", 100
Close #1
End Sub
Private Sub Command2_Click()
Open "e:\zhu zhong zhi\scores.dat" For Input As #1
Dim no, name As String, score As Integer
Dim count, sum As Integer, ave As Single
Do While Not EOF(1)
Input #1, no, name, score
count = count + 1
sum = sum + score
Loop
ave = sum / count
Print ave
Close #1
End Sub