子时过mp3百度云:请问用怎样用VB编写一个程序,能从文本文件中读取数据到数组中
来源:百度文库 编辑:高校问答 时间:2024/04/30 02:07:22
Private Sub Command1_Click()
Dim a(3) As Integer//定义一个数组
Dim var1
Dim i As Integer
Open "c:\data.txt" For Input As #1
Do While Not EOF(1)///开始循环
Line Input #1, var1
a(i) = var1 //赋值给数组
Debug.Print a(i)///显示数组之中的数据
Print a(i)
i = i + 1
Loop
End Sub