first this line genrates an array of string lists:
private List FileList;
and a list does not need a size, its optional.
maybe you wanted to write:
private List<string> FileList = new List<string>();
private bool invalidate = true;
public void Evaluate(int SpreadMax)
{
if (this.invalidate)
{
FileList.Clear();
}
}
or as array of string lists:
private List<string>[]() FileList;
private bool invalidate = true;
public void Evaluate(int SpreadMax)
{
if (this.invalidate)
{
FileList = new List<string>[FInput.SliceCount](FInput.SliceCount);
}
}
but it might be more easy to manage as a list of lists:
private List<List<string>> FileList = new List<List<string>>();
private bool invalidate = true;
public void Evaluate(int SpreadMax)
{
if (this.invalidate)
{
FileList.Clear();
//add the sub lists somehow
FileList.Add(new List<string>());
...
}
}
a list also handles an array internally but i find it is more convenient to use and the performance is about the same, even faster in cases because the list code does intelligent memory handling of the internal array…
Hi tonfilm, that’s exactly what i’m doing, i’m generating array of lists with filenames.
The logic is pretty simple, as i got spreadable input of filenames, for each slice on input, i get all the files in the folder and index of my file. Then i can change previous next file with bangs. But if input is changed the whole thing gonna get reset…
there is the .cs file i started to rewrite, if u can take a look, maybe u can provide me with some feedback…
makes a new local variable that is forgotten when the evaluate method is done… but what you want is to re/use the class field FileList, so DO NOT add the type declaration before the variable name, as i have written in the code above: