Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
Pages: 1
Topic closed
With the included code if i just hit enter without putting in any arguments is prints out:
- There was an error when trying to change value PREFIX.
- There was an error when trying to change the value SEPERATOR.
public static void Main(string[] args)
{
string input = " ";
string appTitle = "CacheMoney";
string consolePrefix = "CM";
string consoleSeperator = "$";
Dictionary<string, string> dictionary = new Dictionary<string, string>();
while (input != "dah")
{
Console.ForegroundColor = ConsoleColor.White; Console.Write(consolePrefix); Console.ForegroundColor = ConsoleColor.Green; Console.Write(" " + consoleSeperator + " "); Console.ResetColor();
Console.Title = appTitle;
input = Console.ReadLine();
string[] parse = input.Split(' ');
if (parse[0] == "exit" || parse[0] == "quit")
input = "dah";
if (parse[0] == "set")
try { if (parse[1] == "title") appTitle = parse[2]; } catch { Console.WriteLine(" - There was an error when trying to change the value TITLE."); }
try { if (parse[1] == "prefix" || parse[1] == "pre") consolePrefix = parse[2]; } catch { Console.WriteLine(" - There was an error when trying to change value PREFIX."); }
try { if (parse[1] == "seperator" || parse[1] == "sep") consoleSeperator = parse[2]; } catch { Console.WriteLine(" - There was an error when trying to change the value SEPERATOR."); }
if (parse[0] == "mbox" || parse[0] == "messagebox")
try { MBOX(parse[1], input.Substring(parse[2].Length + 1 + parse[0].Length + 1)); } catch { Console.WriteLine(" - There was an error when trying to create a MessageBox."); }
if (parse[0] == "print")
try { Console.WriteLine(" - " + parse[1]); } catch { Console.WriteLine(" - There was an error when trying to use the print function."); }
if (parse[0] == "definition" || parse[0] == "define" || parse[0] == "def")
try { Console.WriteLine(dictionary[parse[1]]); } catch { Console.WriteLine(" - There was an error when trying to find a definition."); }
}
}
Offline
Nevermind, I decided to close off the if statements with '{}'s and it worked perfectly fine. This thread never happened.
Offline
It never happened.
I have never thought of programming for reputation and honor. What I have in my heart must come out. That is the reason why I code.
Offline
Pages: 1
Topic closed
[ Started around 1732465311.9776 - Generated in 0.034 seconds, 12 queries executed - Memory usage: 1.36 MiB (Peak: 1.45 MiB) ]