Added procedure WaitForReturn in MVCFramework.Console.pas

This commit is contained in:
Daniele Teti 2020-05-25 15:18:32 +02:00
parent 32fd704d83
commit 87c712d640
2 changed files with 8 additions and 1 deletions

View File

@ -75,6 +75,7 @@ function GetConsoleSize: TMVCConsoleSize;
function GetConsoleBufferSize: TMVCConsoleSize;
procedure ClrScr;
function GetCh: Char;
procedure WaitForReturn;
function ColorName(const color: TConsoleColor): String;
@ -97,6 +98,11 @@ begin
Result := GetEnumName(TypeInfo(TConsoleColor), Ord(color));
end;
procedure WaitForReturn;
begin
while GetCh <> #13 do;
end;
{$IFDEF LINUX}
procedure Init; inline;
begin

View File

@ -65,7 +65,8 @@ begin
http://www.indyproject.org/docsite/html/frames.html?frmname=topic&frmfile=TIdCustomTCPServer_ListenQueue.html }
LServer.ListenQueue := 200;
Writeln('Press RETURN to stop the server');
ReadLn;
WaitForReturn;
TextColor(Red);
Writeln('Server stopped');
ResetConsole();
finally