I'm really interested - why do you need to put
readln;
line after reading some value from keyboard into variable? For example,
repeat
writeln('Make your choise');
read(CH);
if (CH = '1') then begin
writeln('1');
end;
{ ... }
until CH = 'q';
If you run the following code, and press '1' on keyboard, you get an output like
1
Make your choise
Make your choise
Make your choise
On the other hand, if you add that "readln;" line, it all works perfect:
repeat
writeln('Make your choise');
read(CH);
readln;
if (CH = '1') then begin
Writeln('1');
end
until CH = 'q';
My only guess is that calling readln without arguments terminates the process of reading the keyboard input. But if so, why cant the read/readln functions stop reading input themselves, to avoid such a clumsiness?