Hi Andy,
This looks like .NET code. Not too easy for crusty old vb6 monkeys to help :)
Afraid I'm VB6 too, but could it be related to not closing the reader after the first time through the file? I'm not familiar with the Double.TryParse business, guess I would have used Val() or Cdbl() functions.
Also, on closer inspection, even without really being familiar with .NET, this construction
- readArray(i) = Double.TryParse(WorkString, readArray(i))
just doesn't look correct.
readArray(i) is both one of the two parameters, and the output. Perhaps the value returned by the TryParse method (-1 or 0 in this case) is simply a success/failure indicator. Maybe try putting that in a dummy variable. Or, if it is valid syntax, just do this
- Double.TryParse(WorkString, readArray(i))