I pasted this section into a console app:
while (true)
{
string choice = Console.ReadLine();
string[] spl = choice.Split('/');
switch (spl[0])
{
case "help":
switch (spl[1])
{
case "programs":
Console.WriteLine("Available programs commands are:");
Console.WriteLine("Run, Manage, list.");
break;
case "files":
Console.WriteLine("Available files commands are:");
Console.WriteLine("Open, Delete, lock, list.");
break;
default:
Console.WriteLine("Astro OS doesn't understand. What is ");
Console.Write(spl[1]);
Console.Write("?");
break;
}
break;
}
}
And it worked exactly as expected so i would suggest debugging and checking the contents of "spl" when you enter the switch.
Also, please use[CODE][/CODE] tags when posting code as it preserves the formatting, making it much easier to read.
Ryshad
Nearly a Posting Virtuoso
1,307 posts since Aug 2009
Reputation Points: 512
Solved Threads: 246