ugzannin@sunybcs.UUCP (Adrian Zannin) (10/15/86)
O.K....here goes. I recently started working for a place that uses an IBM PC for inventory posting. The basic story is that the guy they had there running the machine before was literally self-taught and made a bloody mess of the system. Anyway, I was originally hired as a parts counter man, but since I am going to school for computers I kind of "aquired" the job of maintaining the system. The only thing is is that they don't give me much to work with. The other guy wrote his inventory posting program in DBASE III+ and when he left he took that with him, so basically the only thing I have to work with is BASIC. (By the way, I just installed DOS 3.0...I found it buried under a bunch of stuff, so I have no idea if they have any later versions). Now, being a "newcomer" to IBM PC's (I'm used to VAXes...:-) ) I need some help. In BASIC or BASICA, how can you effectively trap the ctrl-BREAK sequence so that it won't terminate the program? I have managed to tackle the problem only half way...I do this at the beginning of the program: 100 key 16, chr$(&h04) + chr$(&h46) 'define the ctrl-BREAK sequence 110 key(16) on 'set the trap 120 on key(16) gosub 10000 'tell where to go on key Now, this traps the ctrl-BREAK sequence *ONLY IF* the Numlock or the Capslock key is *NOT* set. If either one or both of them is set, it doesn't trap it and the program terminates. Does anyone out there have a solution to this problem? Also, is is possible to set a trap in DOS so that a batch file cannot be interupted with a ctrl-C or ctrl-BREAK? I need solutions to this because some of these programs involve passwords, and if you can terminate the program you may as well forget the passwords... I would apreciate any help that I can get because these people are rather anxious to get some real work done...(I wish they would get a C compiler!). Please respond via e-mail because I just started reading this group and I have 200+ articles to read. Thanks in advance! Oh yeah...I almost forgot...in the above question, if I hit either shift key and ctrl-break, the trap doesn't work either... -- Adrian Zannin -- SUNY at Buffalo Computer Science UUCP: ..{bbncca,decvax,dual,rocksvax,watmath,sbcs}!sunybcs!ugzannin CSNET: ugzannin@Buffalo.CSNET BITNET: ugzannin@sunybcs.BITNET ARPANET: ugzannin%Buffalo@csnet-relay.ARPA