October 28th, 1999, 07:40 AM
Sorry for this simple question but I can't get it to work.
I have a flie containing the following data:
-284.54846,1410.51934,1236.72798,0.33503,99.91082,-4.85981,
-284.62285,1411.69948,1236.76968,0.19495,99.90012,-5.02847,
-282.50771,1446.90985,1235.03359,-7.47812,98.95525,-8.90596,
-282.25956,1449.06646,1234.75091,-8.24174,98.84281,-8.93968,
-282.25956,1449.06646,1234.75091,-8.24174,98.84281,-8.93968,
I wand to read the information and assign each number to a variable. I worte the following code:
Dim j,k As Integer
Dim info(0 To 120, 0 To 5) As Double
Open "C:\file.txt" For Input As #1
Do While (Not EOF(1))
Input #1, info(j, 0), info(j, 1), info(j, 2), info(j, 3), info(j, 4), info(j, 5)
j = j + 1
Loop
However, when I try to run VB I get an error saying: "Input pass EOF".
1. Is there a better way to solve tis problem?
2. I will need to also write to this file - should I define it as random access file?
Thank you for your help.
Ephi.
I have a flie containing the following data:
-284.54846,1410.51934,1236.72798,0.33503,99.91082,-4.85981,
-284.62285,1411.69948,1236.76968,0.19495,99.90012,-5.02847,
-282.50771,1446.90985,1235.03359,-7.47812,98.95525,-8.90596,
-282.25956,1449.06646,1234.75091,-8.24174,98.84281,-8.93968,
-282.25956,1449.06646,1234.75091,-8.24174,98.84281,-8.93968,
I wand to read the information and assign each number to a variable. I worte the following code:
Dim j,k As Integer
Dim info(0 To 120, 0 To 5) As Double
Open "C:\file.txt" For Input As #1
Do While (Not EOF(1))
Input #1, info(j, 0), info(j, 1), info(j, 2), info(j, 3), info(j, 4), info(j, 5)
j = j + 1
Loop
However, when I try to run VB I get an error saying: "Input pass EOF".
1. Is there a better way to solve tis problem?
2. I will need to also write to this file - should I define it as random access file?
Thank you for your help.
Ephi.