Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!hao!oddjob!gargoyle!ihnp4!alberta!sask!lowey From: lowey@sask.UUCP (Kevin Lowey) Newsgroups: comp.sys.ibm.pc Subject: Re: "abort, retry, or ignore?" : help needed Message-ID: <1045@sask.UUCP> Date: 27 Feb 88 23:17:28 GMT References: <2358@chalmers.UUCP> Organization: University of Saskatchewan Lines: 46 Summary: Turbo Pascal handling of Critical Errors (Abort Retry Ignore) In article <2358@chalmers.UUCP>, johnsson@chalmers.UUCP (Thomas Johnsson) writes: > When issuing a read or a write to a diskette station or the printer > and the output unit in question is not ready (e.g. the diskette > station has its gate open, or the the power to the printer is off), > one get the message on the screen > > device not ready: abort, retry, or ignore? > > Now I would like to disable this, and simply let the read or write > operation return with an error indication. (I'm using the DOS file > handle operations, if that's of any help.) Version 4.0 of Turbo Pascal allows you to trap these critical errors as normal run-time errors. It does this by trapping interrupt 24h (the critical error handler) its self. What they do is have a variable which is set whenever a critical error is found, then reset when the error status is checked, called IORESULT. This variable contains a number specifying what kind of error occurred. If you are a programmer, and you are not using Turbo 4.0 (or any other language which has this capability), then you will have to write your own Interrupt 24 handler to override the default MS-DOS Abort-Retry-Ignore message. Make sure you handle all the error conditions which can arise (write protected disk, drive door left open, disk not formatted, etc.) If you are not a programmer, you will have to get one to write a TSR program for you to do the above function. This may not be advisable however because you would lose the ability to re-start after an Abort-Retry-Ignore message by fixing the problem and typing R for Retry. If you are having this problem with a serial printer, or a communication port, you can use the MS-DOS MODE command to tell the computer to keep re-trying, rather than give the error message. You do this by adding ",P" at the end of the mode command used to initialize your serial port. Eg: MODE COM1:9600,8,n,1,P Hope this helps: ______________________________________________________________________________ | Kevin Lowey |The above is the personal opinion of Kevin | | University of Saskatchewan |Lowey. It does not reflect the position of| | Computing Services |the University of Saskatchewan in any way. | | SaskTel: (306) 966-4826 | | | Bitnet:LOWEY@SASK. (preferred) |I am in no way affiliated with any of the | | UUCP: ihnp4!sask!lowey.uucp |above mentioned companies other than U of S| |________________________________|___________________________________________|