[comp.lang.pascal] Turbo Pascal v6.0 crt bug

popkin@osric.cs.odu.edu (Brian N. Popkin) (05/09/91)

In the following program the chkcbreak doesn't stop me from breaking the 
program.  I press break once while its running, its does nothing, if I press
it a second time it breaks and exits the program... is this a bug?

program test(input,output);

uses
  crt;

var
  dummy : char;
  CheckBreak : Boolean;

begin
  CheckBreak := FALSE;
  writeln;
  writeln('Hey....Press Enter');
  readln(dummy);
  writeln('Hey....Press Enter');
  readln(dummy);
end.



I have also tried CRT.CheckBreak := False..

The manual says of you set it to false it should not allow the user to break
the program..

Brian

*-----------------------------------------------------------------------------*
*  Brian Popkin - Computer Science Major - Systems Programing                 *
*  Old Dominion University - Norfolk, Virginia USA                            *
*									      *
*  Others Areas Of Interest: Artificial Intelligence, Expert Systems,         *
*                            Networks, And Telecommunications                 *
*                                        				      *
*  Email Address: popkin@cs.odu.ede - popkin@xanth.cs.odu.edu                 *

wyoung@cis.ksu.edu (William J. Young) (05/10/91)

In article <1991May9.161613.26915@cs.odu.edu> popkin@osric.cs.odu.edu (Brian N. Popkin) writes:
>
>In the following program the chkcbreak doesn't stop me from breaking the 
>program.  I press break once while its running, its does nothing, if I press
>it a second time it breaks and exits the program... is this a bug?
>

From the IDE, this has been the way TP has worked since at least TP4.0
(for me anyway).  I always assumed (although it's not documented anywhere
I've found) that this was to allow you to check that the Break was caught
if you wanted it to be, but also allow you a way to break out of a program
while still debugging it under the IDE.  Anyone else with other insight?

--
----------------------------
Bill Young 
wyoung@cis.ksu.edu

bobb@vice.ICO.TEK.COM (Bob Beauchaine) (05/10/91)

In article <1991May9.210535.1714@maverick.ksu.ksu.edu> wyoung@cis.ksu.edu (William J. Young) writes:
>In article <1991May9.161613.26915@cs.odu.edu> popkin@osric.cs.odu.edu (Brian N. Popkin) writes:
>>
>>In the following program the chkcbreak doesn't stop me from breaking the 
>>program.  I press break once while its running, its does nothing, if I press
>>it a second time it breaks and exits the program... is this a bug?
>>
>
>From the IDE, this has been the way TP has worked since at least TP4.0
>(for me anyway).  I always assumed (although it's not documented anywhere
>I've found) that this was to allow you to check that the Break was caught
>if you wanted it to be, but also allow you a way to break out of a program
>while still debugging it under the IDE.  Anyone else with other insight?
>

  Just for grins, I compiled a similar program with checkbreak set to
  false (yes, the CRT variable).  From the IDE, pressing the CTRL-BRK
  key interrupted the program and sent me back into the IDE (as I 
  would like it to do for debugging).  When I compiled the program
  to disk, the executable wouldn't break (I had to reboot to get out).
  In my opinion, this is proper, if undocumented behavior.

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 

Bob Beauchaine bobb@vice.ICO.TEK.COM 

C: The language that combines the power of assembly language with the 
   flexibility of assembly language.

dvlhma@cs.umu.se (Henrik Magnusson) (05/13/91)

In article <1991May9.161613.26915@cs.odu.edu> popkin@osric.cs.odu.edu (Brian N. Popkin) writes:
>
>In the following program the chkcbreak doesn't stop me from breaking the 
>program.  I press break once while its running, its does nothing, if I press
>it a second time it breaks and exits the program... is this a bug?
>
>program test(input,output);
>
>uses
>  crt;
>
>var
>  dummy : char;
>  CheckBreak : Boolean;
>
>begin
>  CheckBreak := FALSE;
>  writeln;
>  writeln('Hey....Press Enter');
>  readln(dummy);
>  writeln('Hey....Press Enter');
>  readln(dummy);
>end.
>
>
>
>I have also tried CRT.CheckBreak := False..
>
>The manual says of you set it to false it should not allow the user to break
>the program..
>
>Brian
>
Why are you redefining checkbreak (line 8 in your program).
I've used checkbreak many times without any kind of trouble. Try
without redefining checkbreak. If it doesn't work send me a note and
i'll give you an extract of a program where i use it without any trouble.

/NeNNe

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Henrik Magnusson           :: "How'd you puncture that tyre?"           ::
:: dvlhma@cs.umu.se           :: "Ran over a milk bottle"                  ::
::                            :: "Didn't you see it?"                      ::
:: Umeaa University, Sweden   :: "Damn kid had it under his coat."         ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::