🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2089

Re: Over-riding ^C termination via TPascal 4.0

#2089
From: Joel Spolsky
Date: Thu, 06 Sep 1990 13:57
23 lines
1611 bytes
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?

One way to do this:

- use the bios directly to get all keystrokes; there is a function in 
  TurboPascal (probably called BiosKey or something) to do this. That
  will let you get ^C, ^S, ^P, ^Q, and lots of other goodies that
  would otherwise have special meaning.

- install your own ctrl-break handler. For this I refer you to any 
  good book on programming with interrupts, or the interrupt list.
  Basically you need to use the DOS getvector function to find out
  where ctrl-break's are going, then DOS setvector to redirect them
  to one of your functions, then finally setvector when your program
  exits to restore the original Ctrl-Break handler. 

Perhaps there is some built in Turbo Pascal-specific way to do this?

Joel Spolsky
spolsky@cs.yale.edu                                        Talk Hard.
Technical Details
Message-ID: <26028@cs.yale.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!yale!cs.yale.edu!spolsky-joel
References: <billq.652551823@s.ms.uky.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!yale!cs.yale.edu!spolsky-joel
From: spolsky-joel@cs.yale.edu (Joel Spolsky)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Over-riding ^C termination via TPascal 4.0
Message-ID: <26028@cs.yale.edu>
Date: 6 Sep 90 13:57:08 GMT
References: <billq.652551823@s.ms.uky.edu>
Sender: news@cs.yale.edu
Distribution: comp
Organization: Yale University Computer Science Dept., New Haven, CT 06520-2158
Lines: 23
Nntp-Posting-Host: zoo-gw.cs.yale.edu
Originator: spolsky@suned.CS.Yale.Edu