I currently have the below code:
public int GetSeatInfoString(DisplayOptions choice, out string[] strSeatInfoStrings)
{ strSeatInfoStrings = null; int count = GetNumOfSeats(choice); if ((count <= 0)) return 0; strSeatInfoStrings = new string[count]; int i = 0; for (int index = 0; index <= m_totNumOfSeats - 1; index++) { if (string.IsNullOrEmpty(m_nameList[index])) strSeatInfoStrings[i++] =m_nameList[index].ToString(); }
}
This code produces an error of, "...GetSeatInfoString.DisplayOptions, out string[])': not all code paths return a value. Basically, what I am looking to do in the above method is to cycle through an array and for any values in the array that contain a string, I want these then adding to the new array, strSeatInfoStrings which in turn, can be called from a separate class and the new array content then displayed in a listbox.
Any suggestions on how to rectify this?
Thanks in advance