[fpc-pascal] The crt unit

Carsten Bager carsten at beas.dk
Thu Sep 7 14:04:07 CEST 2006


If you run this small program on a Linux machine (386/Arm), you 
will se that if you presses the keys so 2 or more lines are written and 
then presses the 'a' key that writes out WhereX and WhereY. It will 
write out the right position on the first line (80,1).
If I do the same in windows the cursor donĀ“t move on to the next line.
If I compile the program in TP6, it acts as I would expect. 
I think this is an error in the FPC crt unit.
Do you agree?

Carsten
---------------------------------------
program tst;

uses
   crt;
var
  c:char;
begin
  clrscr;
  c:=chr(0);
  repeat
    if keypressed then
    begin
      c:=readkey;
      write(c);
      if c='a' then
        Write('[',WhereX:1,'/',WhereY:1,']');
    end;
  until c=chr(27);
end.
------------------------------------------------------------------



More information about the fpc-pascal mailing list