for (int i = 0; i < Columns.Count; i++) { if (cfsNumber.Length < FIFTY) { //Starts if spacing = FIFTY - cfsNumber.Length; sw.Write(cfsNumber.PadRight(spacing) + "|"); sw.Flush(); } //Ends if else { //Starts else sw.Write(cfsNumber.Substring(ZERO, FIFTY) + "|"); sw.Flush(); } //Ends else }The if statement is within a switch based off of the variable "i" in the for condition. A sample of the variable that is within the if statement is as follows:
string cfsNumber = data.Column["CFSNUMBER"].ToString();I don't know what I'm missing and I've tried looking on MSDN and other sites. I've read a book by Jon Skeet on C# so I have the basic syntax down and how things work to a certain point but I'm not sure what is going on with the way the compiler is interpreting it. Would anyone know a possible solution to this problem? It has driven me up the wall and I've been working on it for days.