[fpc-pascal] CTRL-Break and asynchronous exec

Jürgen Hestermann juergen.hestermann at gmx.de
Fri Apr 10 16:43:04 CEST 2009

I am trying to port some console programs to Free-Pascal(they use the 
CRT unit and originaly where written for Turbo-Pascal then they were 
ported to Virtual-Pascal). I use "MODE OBJFPC". Now I am stumbling over 
some problems:

1.) I check for keyboard input with the READKEY function. How can I 
avoid that the key STRG-C stops the program? I want to use this key for 
the Copy-to-clipboard function. In the manual "CHECKBREAK" is mentioned 
but there it also says that it's not used (and setting it to FALSE 
doesn't change anything).

2.) Is there a (Free-Pascal) standard function to execute other programs 
synchronously AND asynchronously (so that there is no need to change 
this code for different platforms)? Or do I have to use WinAPI functions 
like CREATEPROCESS for that? Virtual-Pascal had an EXECFLAGS variable 
which controlled the behaviour of the EXEC function. Does something 
similar exist in Free-Pascal?

Thanks in advance for any help.

Jürgen Hestermann.

More information about the fpc-pascal mailing list