public class GlobalVars()
{
private List<string> TextList = new List<string>();
public string GetTextList(int index)
{
return TextList[index];
}
public void SetTextList(string value)
{
TextList.Add(value);
}
}
Now, above is the code. What I do, at first, is I run the SetTextList and it adds a single string value to the textlist, I've seen this happen.
However, once it comes to GetTextList, index is = 0, but the list is of the size zero when it should be at one. So I get an ArgumentOutofRangeExceptionUnhandled because the index "0" is out of range. Any idea how I can fix this?

New Topic/Question
Reply



MultiQuote





|