Path: utzoo!attcan!uunet!usna!baldwin From: baldwin@usna.MIL (J.D. Baldwin.) Newsgroups: comp.lang.pascal Subject: Re: disable ^C in Turbo Pascal Message-ID: <364@usna.MIL> Date: 14 Feb 90 00:41:23 GMT References: <116500002@uxa.cso.uiuc.edu> Reply-To: baldwin@cad.usna.mil (J.D. Baldwin.) Organization: Canoe U. Lines: 36 In article <116500002@uxa.cso.uiuc.edu>, bcs33424@uxa.cso.uiuc.edu writes: > I'm writing a password program in Turbo Pascal for friend's > computer. The program is fine, but I can't disable control-C. > I've tried the break command under DOS, and the {C-}, {C+}, > {$U-}, and the {$U+} (the book I'm using is very vague). With- > out the control-C disabled, the program has no real effect. > Is there something I missed? Is there another compiler directive > I could use? Could the autoexec.bat be written so that, if > the password program is stopped by a ^C that it recalls the > password program, until it is ended normally? Yes, the Crt unit contains a variable CheckBreak : boolean. Setting CheckBreak := false; will have the desired effect. N.B.: the BREAK key *will* work normally when you run the program from the Turbo editor! You must run the .EXE file to see any results from this. There is no way I have heard to do what you desire with DOS, so your scheme can be defeated easily enough by hitting BREAK *before* your program starts. There are such things as security "drivers" (so to speak) that load from your CONFIG.SYS file that cannot be defeated this way--you might look for something like this on BBS's on simtel20 (but beware the data burglar who carries a boot disk in his toolkit). > "The interests of the landlord always oppose the interests of > every othewr class of society." - David Ricardo Like most statements so sweepingly general, this is patently false. -- From the catapult of: |+| "If anyone disagrees with anything I _, J. D. Baldwin, Comp Sci Dept |+| say, I am quite prepared not only to __||____:::)=}- U.S. Naval Academy|+| retract it, but also to deny under \ / baldwin@cad.usna.navy.mil |+| oath that I ever said it." --T. Lehrer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~