Re: Forms 4.5 TEXT_IO-Package

From: Martin Bobrovsky <Martin.Bobrovsky_at_workforce.co.at>
Date: Tue, 14 Jul 1998 13:14:46 +0200
Message-ID: <35AB3DA5.F8536818_at_workforce.co.at>


Gudrun Janssen wrote:

> Hello,
>
> I'm working with Forms 4.5. And right now, I've got two
> questions concerning the TEXT_IO-Package.
>
> I' ve got a CANVAS-View with lots of Input-Fields. I want to
> program the opportunity to save a current state of Input into
> a file. So the user has some files like case1.txt, case2.txt and
> so on, where he can choose from at a later time and then load
> the input again into the different Input-Fields. Everything works
> fine as long as I don't care about the user specifying invalid
> filenames.
>
> How I can I check if the user entered a valid filename
> or not, before/while calling TEXT_IO.FOPEN?
> And second, how can I figure out, if the file already exists?
>
> Thanks for your help!
> Gudrun

If FOPEN fails, it throws an exception, so the following should work:

   ...
   ...
   BEGIN
      f := TEXT_IO.FOPEN(....);
   EXCEPTION

      WHEN others THEN
         -- FOPEN failed

   END; Received on Tue Jul 14 1998 - 13:14:46 CEST

Original text of this message