[comp.lang.pascal] Over-riding ^C termination via TPascal 4.0

ts@uwasa.fi (Timo Salmi LASK) (09/07/90)

In article <billq.652551823@s.ms.uky.edu> billq@ms.uky.edu (Billy Quinn) writes:
>Is there any way I can compile a program written in pascal (Turbo PASCAL)
>version 4.0, so that the program won't terminate with the ^C or ^[break]
>keys?  It's seems that other versions of TPascal have compiler directives
>to do such a thing but for some reason, version 4.0 does not accept these
>compiler directives.  Other programmers have told me of an un-documented
>command called 'cbreak' whic is supposed to be set to 'true' to control
>this sort of thing, however, I connot get this to work either. Any help     
>will be greatly appreciated!

This is one of the most frequently asked questions about TP.  The
statement about TP 4.0 not having this feature is false.  Just take
a look at your TP 4.0 manual for the CheckBreak keyword.  And, it is
not a compiler directive but a predefined constant that can be set
true (default) or false.  If it is false, you can capture ^C and the
break key by testing if ReadKey returns a #3.  (CBreak is an
obsolete Turbo Pascal version 3 keyword).  Also note that in order
to be able to use CheckBreak, you'll have to include the Crt unit in
your uses statement.  I hope this helps you in the right direction. 

...................................................................
Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun