Forms 4.5 multi form exit

From: Larry Reid <lcreid_at_^^^^^^web.net>
Date: Mon, 29 Mar 1999 17:47:04 -0800
Message-ID: <lcreid-2903991747040001_at_a1a63311.sympatico.bconnected.net>



I'm trying to take an existing application that had one form open at a time, and convert it to a multi-form application, with more than one form open in a single instance of Oracle Forms runtime. Each form is started by a call to:

open_form(form, activate, session);

I would like to have the Exit menu item close all the forms and exit. The default exit behaviour only closes the frontmost window. I'm currently trying this procedure, which is called from the Exit menu item:

procedure close_all is

   form_id     formmodule;
   this_id     formmodule;
   from_number number;

   begin
   this_id := find_form(:system.current_form); -- message('current ID ' || to_char(this_id.id));

   for form_number in 1 .. to_number(:system.last_form)

      loop

-- The idiom that follows took me a long time to find.
-- It's not clear in any documentation.
form_id.id := form_number;
  • message('Form: ' || to_char(form_number));
    • skip the current form, so we don't fall
    • out of this loop.
    • All numbers are used (there are no holes
    • after you close a form). if this_id.id <> form_id.id then close_form(form_id); end if; end loop;
  • message('About to key-exit'); execute_trigger('key-exit'); end close_all;

When I choose Exit from the File menu, I get an Oracle error "Unable to navigate out of form."

I suspect that I'm on the wrong track completely, but I've exhausted all my leads for finding the right track. I thank you for any help you can give.

The forms run in Oracle Forms 4.5 on NT 4.0 SP3. The database is 7.3.3 on Digital Unix 4.0E on an AlphaServer.

-- 
Larry Reid                             lcreid_at_^web.net (remove the ^)
Received on Tue Mar 30 1999 - 03:47:04 CEST

Original text of this message