program HelloWorld;
{$APPTYPE CONSOLE}
uses
Windows,
SysUtils;
function ClearConsoleScreen(): Boolean;
var
ConsoleOutput: THandle;
ConsoleScreenBufferInfo: TConsoleScreenBufferInfo;
WriteCoord: TCoord;
NumberOfCharsWritten: DWORD;
begin
Result := False;
ConsoleOutput := GetStdHandle(STD_OUTPUT_HANDLE);
if ConsoleOutput <> INVALID_HANDLE_VALUE
then
begin
if GetConsoleScreenBufferInfo(ConsoleOutput, ConsoleScreenBufferInfo)
then
begin
WriteCoord.X := 0;
WriteCoord.Y := 0;
if FillConsoleOutputCharacter(ConsoleOutput, '
',
ConsoleScreenBufferInfo.dwSize.X * ConsoleScreenBufferInfo.dwSize.X,
WriteCoord, NumberOfCharsWritten)
then
begin
Result := SetConsoleCursorPosition(ConsoleOutput, WriteCoord);
end;
end;
end;
end;
begin
try
WriteLn('
Hallo');
ClearConsoleScreen();
WriteLn('
World');
except
on E:
Exception do
Writeln(E.Classname, '
: ', E.
Message);
end;
ReadLn;
end.