Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-07

Crt changes behaviour of long line wrapping with write on Win terminal

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Seweryn Walentynowicz

I compile this simple program:

program Bug817;
uses Crt;
begin
 write('one line over 40 chars long--------------');
 write('the second one+++++++++++++++++++++++++++');
 writeln('and third################################');
end.

correct output from this program looks like:

one line over 40 chars long--------------the secondone+++++++++++++++++++++++++++and third################################

// one line over 80 chars wrapped at end of terminal line

This result I got on any linux terminal, but if I compile and run this on Windows terminal window, this look like below:

one line over 40 chars long--------------and third##############################

// one line where each next text in line override last one

If I remove 'uses Crt' from this program, all works fine on both linux and Windows. Of course, 'write' doesn't need this unit, but I need it for other reason.
Why including Crt unit changes behaviour of write() procedure ? How can I solve this in windows terminal ?

regards

Seweryn Walentynowicz