I have one suggestive idea to you try:
Put the code below in lpi ( project1.lpi ) tab:
program project1;
{$mode objfpc}{$H+}
{$APPTYPE CONSOLE}
uses
{$IFDEF UNIX} {$IFDEF UseCThreads}
cthreads, {$ENDIF}
{$ENDIF} {$IFDEF WINDOWS}
Windows, {for setconsoleoutputcp} {$ENDIF}
SysUtils, Classes, crt;
var
Success: boolean;
intOne, intTwo, {intEntered, }ErrCode: integer;
function ValueToSquare( myText: string; var intEntered: integer ): boolean;
var
s: string;
mychar, limit: char;
flag: boolean;
begin
s:= '';
limit:= '1';
mychar:= #0;
flag:= false;
Result:= false;
writeln;
writeln( 'Please values into 11 up to 99 or Esc to exit >' );
write( 'Enter coordinates of square ' + myText + ' (file first) : ');
repeat
mychar:= readkey;
if mychar in [ limit .. '9' ] then
begin
s:= s + mychar;
write( mychar );
if mychar <> '1' then
limit:= '0'; { For '10' exclude. }
if length( s ) = 2 then
begin
WriteLn;
flag:= true;
Result:= true;
val( s, intEntered, ErrCode );
end;
end
else
beep;
until (( flag ) or ( mychar = #27 )); { Escape to exit. }
end;
begin
{$IFDEF WINDOWS}
SetConsoleOutputCP(CP_UTF8);
{$ENDIF}
Success:= false;
if ValueToSquare( 'containing piece to move', intOne ) then
if ValueToSquare( 'to move piece to', intTwo ) then
Success:= true; { ===> Integer results in intOne and intTwo. <===}
Beep;
writeln;
writeln;
if Success then
writeln( '.................... Succesful!....................' )
else
writeln( '......................Aborted!.....................' );
writeln;
writeln( '...............Strike one key to exit..............' );
repeat until KeyPressed;
end.
Good luck.