求教,关于print的问题
问题可能有点愚昧,大侠们不要笑话
题目是:建立1个二进制文件,然后读取文件中的数据
下面是我写的代码,有点问题,输入ttttt 1200 ,输出多出了个0,请大家帮帮忙,看看该怎么改合适
Private Sub Command1_Click()
Dim name As String * 6
Dim salary As Long
Open "f:\fff\gz.dat" For Binary As #1
Do
name = InputBox("姓名:")
salary = Val(InputBox("工资:"))
Put #1, , name
Put #1, , salary
yn = InputBox("是否要继续输入:")
Loop While UCase(yn) = "y"
Close #1
End Sub
Private Sub Command2_Click()
Dim xname As String * 6
Dim xsalary As Long
Open "f:\fff\gz.dat" For Binary As #1
While Not EOF(1)
Get #1, , xname
Get #1, , xsalary
Print xname, xsalary
Wend
Close #1
End Sub