writeln Function while reading a Text File is printing appending text "before text" and "after text" at the same position

ttk ttk at ciar.org
Wed Jun 3 18:49:38 UTC 2020


On Wednesday, 3 June 2020 at 18:23:51 UTC, BoQsc wrote:
> Here you can see ". hahahahahahaha" and "nononono" and even 
> lineNumber is being merged into the same position. Why is this 
> happening and can this be simply resolved?

Your string in "line" has a carriage return character at the end, 
which moves the cursor to the beginning of the display row.

If you remove this trailing carriage return character (0x0D) it 
will display correctly.

With the carriage return character in place, everything written 
to your terminal after the carriage return starts at the 
beginning of the row.



More information about the Digitalmars-d-learn mailing list