I think that I have captured the file name from a file on my hard drive and I think I have loaded the contents of the file into an array. The code I used is:
public void openFileDialog1FileOk(object sender, System.ComponentModel.CancelEventArgs e)
{
string fullPathname1 = openFileDialog1.FileName;
FileInfo src = new FileInfo(fullPathname1);
TextReader reader = src.OpenText();
string line = reader.ReadLine();
while (line != null)
{
}
reader.Close();
}
public void ReadWholeArray1(Stream fullPathname1, int[] dataTable)
{
StreamReader reader = new StreamReader(fullPathname1);
int i = 0;
int fileLength = dataTable.Length;
dataTable = new int[fileLength];
while (i != fileLength)
{
dataTable[i] = reader.Read();
i++;
}
reader.Close();
}
The problem is that when I go to another part of the program to obtain the contents of the array, with something like:
abyte = dataTable[i];
I get the message: The name 'dataTable' does not exist in the current context.
If I have declared the methods as "public", shouldn't I be able to retrieve the data
from the array anywhere in the program?
Alan