I have a loop that will read lines from a file until it hits the 16th. It then grabs that line
splits it up and I store 3 of the values form the line into 3 different arrays. The problem
I'm having is that sometimes it not a double for some reason. Meaning the text file was not
made in the right format.
How would I go about not reading them? do I make an "if" for each array?
Code below
while ((line = file.ReadLine()) != null)
{
if (lineCount == 15)
{
holder = line.Split(',');
elong.Add((double)Convert.ToDouble(holder[2]));
breakStr.Add((double)Convert.ToDouble(holder[3]));
mod.Add((double)Convert.ToDouble(holder[4]));
break;
}
lineCount++;
}
Thanks for any help I may get, have a great day
Stephen

New Topic/Question
Reply



MultiQuote




|