Article View: a.bsu.programming
Article #86781Re: Exception handling question. PLEASE HELP.
From: Sabrena Alvin
Date: Thu, 12 Dec 1996 00:00
Date: Thu, 12 Dec 1996 00:00
54 lines
2897 bytes
2897 bytes
Sabrena Alvin wrote:
>
> Simon Carter wrote:
> >
> > You could try using DiskFree function if the drive is not ready it will
> > return -1
> >
> > Simon Carter
> >
> > Thomas W. Olson <tolson@advancegroup.com> wrote in article
> > <01bbe537$bb381f40$330808ce@tolson.ppp>...
> > > I have been to about a half dozen sites for programmer's and they all
> > have
> > > these offers to make money, but nobody seems to know anything about
> > > programming.
> > >
> > > I am trying to handle the EInOutError exception. The scenario is this:
> > > When the user sets the Drive control to drive A and there is no disk in
> > the
> > > drive, the EInOutError exception gets raised. I want the user to be able
> > > to press a Retry button on a message box and have the drive retried. So
> > > far I have not been able to do this.
> > >
> > > PLEASE HELP
> > >
> > > Sincerely,
> > >
> > > Just Learning
> > >
> > >try using the SELECTDIRECTORY in the following procedure:
>
> var
> dir: string;
> l: longint;
> begin
> dir := 'A:\';
> try
> SelectDirectory(Dir, [], l)
> except
> messagedlg( 'Drive not ready.', mtError, [mbRetry, mbAbort], 0 );
> end;\
Sorry, use directoyrexist instead:
var
dir: string;
begin
dir := 'A:\';
if not Directoryexists(Dir) then
messagedlg( 'Drive not ready.', mtError, [mbRetry, mbAbort], 0 );
end;
Don't forget to add unit "FileCtrl" to your uses statement.
Technical Details
Message-ID:
<32B0656E.6F62@atl.mindspring.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<01bbe537$bb381f40$330808ce@tolson.ppp> <01bbe842$551a67a0$f0e849c2@simon.tmsnet.co.uk> <32B0600E.15AE@atl.mindspring.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5380,752c4e37d7cf87f5 X-Google-Attributes: gidf5380,public X-Google-Thread: fd817,752c4e37d7cf87f5 X-Google-Attributes: gidfd817,public X-Google-Thread: 1006bf,752c4e37d7cf87f5 X-Google-Attributes: gid1006bf,public X-Google-Thread: 107d8b,752c4e37d7cf87f5 X-Google-Attributes: gid107d8b,public X-Google-Thread: 16c3bf,752c4e37d7cf87f5 X-Google-Attributes: gid16c3bf,public X-Google-Thread: 105ac8,752c4e37d7cf87f5 X-Google-Attributes: gid105ac8,public X-Google-Thread: f973d,752c4e37d7cf87f5 X-Google-Attributes: gidf973d,public From: Sabrena Alvin <sabrenaa@atl.mindspring.com> Subject: Re: Exception handling question. PLEASE HELP. Date: 1996/12/12 Message-ID: <32B0656E.6F62@atl.mindspring.com> X-Deja-AN: 203764265 references: <01bbe537$bb381f40$330808ce@tolson.ppp> <01bbe842$551a67a0$f0e849c2@simon.tmsnet.co.uk> <32B0600E.15AE@atl.mindspring.com> to: Sabrena Alvin <sabrenaa@atl.mindspring.com> x-server-date: 12 Dec 1996 19:57:54 GMT content-type: text/plain; charset=us-ascii organization: MindSpring Enterprises mime-version: 1.0 newsgroups: a.bsu.programming,adass.iraf.programming,alt.comp.borland-delphi,alt.comp.lang.borland-delphi,alt.lang.delphi,othernet.sganet.programming,viwa.programming x-mailer: Mozilla 2.02 (Win95; I)