read function seems to be ignored. lazarus / 21-General ---------------------------------------------------------------------- jrgomez · 2025-06-03 01:48 Hi everybody! I'm currently learning to program in Pascal and I'm creating a password generator. I noticed that, for some strange reason, the read function is being 'skipped' after writing a line. In order to troubleshoot this I wrote this test code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i [font=courier]program charanswer;var   answer1 : char;   answer2 : char;   answer3 : char; begin   write('Do you like chocolates? [Y/N]  ');   read(answer1);   writeln('Your answer is: ', answer1);   writeln();   write('Do you like ballons? [Y/N]  ');   read(answer2);   writeln('Your answer is: ', answer2);write('Do you like ponies? [Y/N]  ');   read(answer3);   writeln('Your answer is: ', answer3);end.[/font]  I'm compiling it manually using the command: fpc -g -vwin charanswer charanswer.pas And I'm getting this result: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Do you like chocolates? [Y/N]  YYour answer is: Y Do you like ballons? [Y/N]  Your answer is: Do you like ponies? [Y/N]  As you can see, the second question (Do you like ballons?) is being skipped. Do you have any advice about what I'm doing wrong? Thanks in advance. Regards, Juan Gomez ---------------------------------------------------------------------- jrgomez · 2025-06-03 02:15 I found the problem. readln() and read() behave different.  Definitively I'm a newbie. ---------------------------------------------------------------------- Fibonacci · 2025-06-03 04:26 Your Read()s are picking up Enter (CR+LF), not just your Y/N input. Try ReadKey() from the CRT unit to read a single char, or just use ReadLn(). ---------------------------------------------------------------------- jamie · 2025-06-03 10:53 Readln I ---------------------------------------------------------------------- jrgomez · 2025-06-04 13:25 Quote from: Fibonacci on June 03, 2025, 06:26:04 amYour Read()s are picking up Enter (CR+LF), not just your Y/N input. Try ReadKey() from the CRT unit to read a single char, or just use ReadLn(). Thanks for the advice! Appreciated.