public void StartReadingCommands() { OutputWriter.WriteMessage($"{SessionData.currentsPath}> "); string input = Console.ReadLine(); input = input.Trim(); interpreter.InterpredCommand(input); while (input != endcommand) { OutputWriter.WriteMessage($"{SessionData.currentsPath}> "); input = Console.ReadLine(); input = input.Trim(); interpreter.InterpredCommand(input); } }
public void StartReadingCommands() { while (true) { OutputWriter.WriteMessage($"{SessionsData.currentPath}> "); string input = Console.ReadLine(); input = input.Trim(); if (input == endCommand) { break; } interpreter.InterpredCommand(input); } }
/// <summary> /// Starts reading commands form the keyboard and sends them to the Interpreter /// </summary> public void StartReadingCommands() { //Keep interpreting commands while the program is running while (true) { OutputWriter.WriteMessage($"{SessionData.CurrentPath}> "); var input = Console.ReadLine().Trim(); //If InterpredCommand returns false, it means the program should stop var stopLoop = !interpreter.InterpredCommand(input); if (stopLoop) { break; } } }