[fpc-devel] readln problem

Petr Katovsky petr at katovsky.cz
Mon Oct 29 13:36:31 CET 2007


Hello, i would like to use the Readln command to wait for the user to press
enter before ending the program.

1.First example - it works fine:

program hello;
    begin
      writeln('Hello world');
      readln;
    end.

2.Second example - it does not work.

program NUMBERS (Input,Output);
var A,B : Integer;
begin
        Write ('Find greater number.');
        Write ('Enter two numbers.');
        Read (A,B);
        if A>B then
                Write ('The greater number is',A)
                else
                Write ('The greater number is',B);
                readln;

end.


Could anybody tell me why it does not work?
Thanks a lot




More information about the fpc-devel mailing list