Re: 2 wks, no sol'n from you guys!

From: Lee Levy <levy.lee.ls_at_bhp.com.au>
Date: 1996/02/08
Message-ID: <4fdsnr$9io_at_gossamer.itmel.bhp.com.au>#1/1


In article <3118B2FE.65B4_at_motown.ge.com>, "Ted M. Troccola" <ttroccol_at_motown.ge.com> says:
>
>Here is my LOV (which we will call SCHOOL in block B)
>
> |----------|
> | Fla St |
> | Penn St |
> | Mich St |
> |----------|
>
> I want code like this.
>
> If :B.SCHOOL = 'Fla St' then
> Go_Item('Seminoles');
> Elseif :B.SCHOOL = 'Penn St' then
> Go_Item('Lions');
> Else
> Go_Item('Spartans');
> End if;
>
>
>
>You see... the idea is
>
> I check the value. Then, I must goto a different item.
>
> * NOTE : Go_Item, Go_Block are RESTRICTED PROCEDURES.
> WHEN-VALIDATE-ITEM does not allow the inclusion of
> RESTRICTED PROCEDURES.
>
>
>
>The solution I came up with is using
> Set_Block_Property('B', Next_Navigation_Block, 'wherever')
>to where I need to go depending on the value.
>
>By having the :B.SCHOOL item the last item in the block this
>worked fine, but obviously, this might not always be the case.
>
>
>Thanks,
>Ted
>--
Ted,

The only real way I have found to get around navigating out of a eg. when_validate_item procedure is to use a timer. The technique is as follows...Change:

    If :B.SCHOOL = 'Fla St' then
      Go_Item('Seminoles');
    Elseif :B.SCHOOL = 'Penn St' then
      Go_Item('Lions');
    Else
      Go_Item('Spartans');
    End if;
to:

    If :B.SCHOOL = 'Fla St' then
      create_timer('SEMINOLES',5,NO_REPEAT);     Elseif :B.SCHOOL = 'Penn St' then
      create_timer('LIONS',5,NO_REPEAT);     Else
      create_timer('SPARTANS',5,NO_REPEAT);     End if;
(5 milliseconds is arbitrary, you just want something nice and snappy) and then attach code to a when_timer_expired trigger: DECLARE
  tm_name VARCHAR2(20);
BEGIN
  tm_name := Get_Application_Property(TIMER_NAME);  

  IF tm_name = 'SEMINOLES' THEN
    Go_Item('Seminoles');

  ELSIF tm_name = 'LIONS' THEN 
    Go_Item('Lions');
  ELSIF tm_name = 'SPARTANS' THEN 

    Go_Item('Spartans');
  END IF;
END; Its not a terribly pretty solution, but it does work nicely. nb. the caps are deliberate - timer names must be in caps. I use this solution a lot to return control to the item the stupid user didnt enter properly.

Does that help?
Lee

------/\/\------+---------------------------------------------------
     / / /\     |  Lee Levy, ISSD Systems Development, Del Code (34)
    / / /  \    |  BHP Information Technology,  ACN 006 476 213
   / / / /\ \   |  PO Box 261, Warrawong, NSW 2502, Australia
   \ \/ / / / | PH: +61 42 75-5485 Fax: -5500 Tie: 8855-     \ / / / | Internet : levy.lee.ls_at_bhp.com.au
-----\/\/\/-----+---------------------------------------------------
Opinions expressed are mostly my own, so give me some credit. Received on Thu Feb 08 1996 - 00:00:00 CET

Original text of this message