Hi everyone....
public void LoopGrades()
{
try//Start try block
{
//Start TextReader
TextReader grades = new StreamReader("grades.dat");
ResultOfData = grades.ReadLine();
}
catch (FileNotFoundException e)
{
MessageBox.Show("File Not Found!", "Error");
}
//Loop through grades
while (ResultOfData != null)
{
//ResultOfData is given the value that is read from grades.dat
ResultOfData = grades.ReadLine();
//Call IncrementGrades method
IncrementGrades();
}
grades.Close();
My question is...grades has gone out of scope..could anyone please tell me how I can gain access to it from the while loop??
ResultOfData is declared in the class if anyone was wondering whats going on there......
Thanks for your help...