[fpc-pascal]Re: Better Alternative to delay()
nite at c2i.net
Wed Oct 15 18:09:51 CEST 2003
On Wed, 15 Oct 2003 13:59:44 +0930, George Patterson wrote:
> Hi all,
> I am using the delay function to pause for an amount of time which works
> but will not allow the user to stop the program from the console, using
> ctrl-C. If I could trap the keystroke, I would be happy.
> Excuse the indentation...
> while not eof(sin) do
> readln (sin, line);
> writeln (line);
> delay(250); //time is measured in milliseconds
> until keypressed;
if ReadKey = [CTRL-C] then ...
> close (sin);
Untested and somewhat wrong syntax, but if I understand your question
correctly, ReadKey should be what you are looking for.
Vennlig hilsen / Best regards
More information about the fpc-pascal