KN>I was wondering if there was a way to eliminate the errors that occur when
KN>somebody pulls a disk out of a floppy and then tires to shut down the
KN>program being run off it. I have written a utility that runs off a
KN>floppy and it would be great to not have "not ready errors" when somebody
KN>shuts down my program when the disk is not in the drive. I believe I have
KN>seen other utilities that do this, so I am just wondering if there is
KN>way with Powerbasic.
KN>Kevin Noble
KN>Internet: Noble@Siast.sk.ca
Kevin,
This type of error is known as a "critical error" and BASIC's own file
i/o routines won't let you trap critical errors.
Because PowerBASIC has a built-in assembler, in theory you _could_ use
it to program around this fact. Luckily, you don't need to go that far.
Try to get a copy of PBFILES.ZIP. It is a freeware file i/o library I
wrote that allows you to trap critical errors, using commands that look
and act like the BASIC file commands in PB (for FOR BINARY files). It
can handle simple ASCII text files, too.
Since you are in Canada, I don't know what sort of premium you pay
to dial up the USA, but here are three ways to get PBFILES.ZIP:
1) it's on CompuServe, in the PowerBASIC Forum library, under the name
PBFILE.ZIP (since CIS only allows 6.3 char file names). GO PCVENB,
and look in library 12.
2) it's on the PowerBASIC BBS, at 1-408-659-7401, under PBFILES.ZIP.
3) you can FIDO freq it (as PBFILES.ZIP, aprox. 34K) from
105/317 - 14.4 v32
105/314 - 14.4 HST Dual Standard (9600 v32)
105/330 - 14.4 v32
When the next version of PB/Xtra comes out on CD-ROM, it should also be
available that way. And there is a movement afoot to make it available
for ftp on simtel sites. I don't know how long before that happens,
since it is out of my hands.
I hope this helps.
Brian
* SLMR 2.1a * MAXLIB For PB v1.1 - Access arrays and files in EMS/XMS!
--- WILDMAIL!/WC v4.12
---------------
* Origin: Com-Dat BBS - Hillsboro, OR. HST DS (1:105/314.0)
|