Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Delphi 7 / ForceDirectories

309 views
Skip to first unread message

Tom Hahn

unread,
Jun 21, 2003, 11:10:22 PM6/21/03
to
Using Delphi 7, ForceDirectories displays an error message when given a
malformed directory string. According to the Help file, it should return
false when failing and true when successful. An extreme example:

if not ForceDirectories ('garbage') then
begin
// handle the error
end;

results in an error message the says "Unable to create directory."

Try.. Except also does not seem to work.

What is wrong?

Tom

Rudy Velthuis (TeamB)

unread,
Jun 21, 2003, 11:28:37 PM6/21/03
to
Tom Hahn wrote:

Are you sure? Or does the debugger capture the exception before it caneb
handled, hands it to you to look at it, and if you continue by presing F9
again, it will be handled after all?

BTW, is this SysUtils.ForceDirectories or FileCtrl.ForceDirectories? They
are not entirely the same, AFAIK.
--
Rudy Velthuis (TeamB)

"Being on the tightrope is living; everything else is waiting."
-- Karl Wallenda

Tom Hahn

unread,
Jun 22, 2003, 2:04:34 AM6/22/03
to

"Rudy Velthuis (TeamB)" <rvel...@gmx.de> wrote in message
news:3ef52265$1...@newsgroups.borland.com...

> > Using Delphi 7, ForceDirectories displays an error message when given a
> > malformed directory string. According to the Help file, it should return
> > false when failing and true when successful. An extreme example:
> >
> > if not ForceDirectories ('garbage') then
> > begin
> > // handle the error
> > end;
> >
> > results in an error message the says "Unable to create directory."
> >
> > Try.. Except also does not seem to work.
>
> Are you sure? Or does the debugger capture the exception before it caneb
> handled, hands it to you to look at it, and if you continue by presing F9
> again, it will be handled after all?
>
> BTW, is this SysUtils.ForceDirectories or FileCtrl.ForceDirectories? They
> are not entirely the same, AFAIK.

I was using SysUtils version, and you are correct about the debugger.

Thanks for your help.

Tom


0 new messages