🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Aborting program with ^C

#2064
From: Stan Brown, Oak Road Systems
Date: Tue, 04 Sep 1990 17:20
38 lines
2216 bytes
In article <39616@cci632.UUCP>, cpp@cci632.UUCP (Carl P. Petito) writes:
> I have a program that I would like to be able to terminate from the
> keyboard.  QC2.5 has an example using 'signal' that I used; however, it appears
> that the only time ^C is effective is when the program is doing i/o to
> the console.

[detailed description omitted]

Carl, this is probably related to a missing BREAK command.

Before running your program, at the DOS prompt type
	BREAK
You'll probably see "BREAK is off".  This means that the only time DOS is
monitoring for ^C is during console and printer I/O.  (There may be one
or two other instances.)

If you type the command
	BREAK ON
and then run your program, you should be able to interrupt it with ^C at
any time.

Note: ^C and ^Break are not quite the same.  If you have a running program
and type keystrokes into the keyboard buffer, ^C won't get processed until
after those keystrokes.  However, ^Break gets processed right away (if
BREAK is on) even if there are unused keystrokes in the input buffer.  It
seems strange that this should be so, since the manuals talk about them as
interchangeable, but the above has been my experience.  (Also, the ^Break
or Ctrl-Break combination may be obtained by pressing and holding the Ctrl
key, then pressing ScrollLock, then releasing both keys.  Depends on your
keyboard.)

Check your DOS manual for the exact format of BREAK command in CONFIG.SYS.
In AUTOEXEC.BAT, it's the same as at the command prompt.

Stan Brown, Oak Road Systems, Cleveland, Ohio, U.S.A.         (216) 371-0043
The opinions expressed are mine. Mine alone!  Nobody else is responsible for
them or even endorses them--except my cat Dexter, and he signed the power of
attorney only under my threat to cut off his Cat Chow!
Technical Details
Message-ID: <750.26e39bf9@iccgcc.decnet.ab.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!abvax!iccgcc!browns
References: <39616@cci632.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!abvax!iccgcc!browns
From: browns@iccgcc.decnet.ab.com (Stan Brown, Oak Road Systems)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Aborting program with ^C
Message-ID: <750.26e39bf9@iccgcc.decnet.ab.com>
Date: 4 Sep 90 17:20:07 GMT
References: <39616@cci632.UUCP>
Distribution: usa
Lines: 38