使用 vb 读取 tex 文件,并且把每一行的值赋值到数组中,然后调用数组里的值进行运算,请问我的算法应该怎么改进
数据文件21.365
24.052
20
18
1.246
4.562
-3.102
我的程序
Dim fileName As String
Dim startnumber%, endnumber%
Const MyFile = 1
Dim i%
Dim j%
Dim T(100) As Double
Dim s(8) As Double
Open "D:\date.txt" For Input As #MyFile '打开文件
Input #MyFile, startnumber, endnumber '读文件
For i = startnumber To endnumber
Input #MyFile, T(i)
Next i
Close #MyFile '关文件
For j = 5 To 7
List1.AddItem T(j)
Next j