public static void SearchErrors(string[] text) { Errors ERR = new Errors(); int firstline = -1; for (int a = 0; a < bCount; a++) { for (int i = bStart[a]; i < bEnd[a]; i++) { if (text[i].Length > 4 && text[i].Substring(0, 4) == "var ") { if (text[i].IndexOf('=') == -1) { if (text[i].IndexOf(',') != -1) { ERR.AddListItem("Line " + i + ": multiply definition not suported."); } else { ERR.AddListItem("Line " + i + ": where is variable's value?"); } } else if (text[i].Substring(4, text[i].IndexOf('=') - 4).Trim().Length == 0) { ERR.AddListItem("Line " + i + ": where is variable's label?"); } else { ERR.AddListItem("Line " + i + ": cannot parse dynamic-type variable outside of function or method."); } if (firstline == -1) { firstline = i; } } else if (text[i].Length > 7 && text[i].Substring(0, 4) == "delete ") { ERR.AddListItem("Line " + i + ": cannot parse delete..."); if (firstline == -1) { firstline = i; } } } } if (firstline > 0) { MainClass.parsing.SetProgress(100, "errors... Have errors!"); ERR.SetText(text); ERR.SetFirstLine(firstline); MainClass.parsing.Close(); System.Environment.ExitCode = 1; ERR.SelectFirstLine(); } else { MainClass.parsing.SetProgress(100, "errors... DONE!"); File.WriteAllLines(MainClass.map.PATH + "\\war3map_parsed.j", text); System.Environment.ExitCode = 0; } }