program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
Windows,
Messages,
SysUtils;
var
userInput: Char;
str,Str1: String;
hStdOut: HWnd;
ScreenBufInfo: TConsoleScreenBufferInfo;
Coord1: TCoord;
i: Integer;
Procedure CLS;
begin
GetConsoleScreenBufferInfo(hStdOut, ScreenBufInfo);
{the GetConsoleScreenBufferInfo API gets the size of
the buffer I need}
for i := 1 to ScreenBufInfo.dwSize.Y do
WriteLn('');
Coord1.X := 0;
Coord1.Y := 0;
SetConsoleCursorPosition(hStdOut, Coord1);
{SetConsoleCursorPosition API sets your cursor
to the Coord1, at 0, 0 the beginging}
Readln(str1);
end;
procedure test;
begin
writeln('Please Choose:'#10#13'c|C Continue'#10#13'a|A Abort'#10#13's|S Shut The Alert Down'#10#13'You''r Choise: ');
userInput := '0';
read(userInput);
Case UpCase(userInput) Of
'C':
Writeln('You chosed:', userInput);
'A':
Writeln('You chosed:', userInput);
'S':
Writeln('You chosed:', userInput);
Else
Writeln('Wrong Option: "', userInput, '"');
End;
end;
begin
while userInput<>'A' do
begin
cls;
test;
end;
end.