Re: To skip or not to skip a field in SQL*FORMS

From: <champs_at_cnb07v.hhcs.gov.au>
Date: 28 May 93 09:27:29 +1000
Message-ID: <1993May28.092729.1_at_cnb07v.hhcs.gov.au>


In article <1993May26.160031.4758_at_macc.wisc.edu>, dly_at_vms.macc.wisc.edu writes:
> I won't reiterate the problem, but I would like to share the solution
> that we settled on. Many thanks to Carl Pdersen, Marc (no last name),
> and especially Steven Champness.

Glad I could help.

>
> Briefly, I would like to skip over some fields depending on what the
> contents are in a previous field.
>
> I liked Steven's idea of naming the SIN (Skip IF NULL) fields.
> I put skip_ahead in the ON-NEW-FIELD-INSTANCE trigger on the form level
> I put skip_back in the KEY-PRVFLD trigger on the form level
> On all enterable fields, the attribute automatic skip is on.
>
> procedure skip_ahead is
> BEGIN
> if NAME_IN(FIELD_CHARACTERISTIC(:SYSTEM.CURRENT_FIELD,PREVIOUSFIELD))
> is not null and substr((:SYSTEM.CURRENT_FIELD),1,3) = 'SIN' then
> next_field;
> end if;
> END;
>
> One worry for the skip_ahead procedure is that if your CURRENT_FIELD is
> the first field in the block, SQL*FORMS will complain. I haven't come
> up with a good fix for that condition yet.
>

Just add an extra test to the start of the if statement

  if :SYSTEM.CURSOR_FIELD != :SYSTEM.CURSOR_BLOCK || '.' ||

        BLOCK_CHARACTERISTIC(:SYSTEM.CURSOR_BLOCK,FIRST_FIELD)     and ......
    and ......
  then
    ...
  end if;

That should take care of your first field problem.

> Thanks for all your help and interest!
>
> -- Debbie Yoshihara
> University of Wisconsin
> Department of Biostatistics

Bye for now.


    /\       Steven Champness (champs_at_cnb07v.hhcs.gov.au)
   /  \      Dept of Health, Housing, Local Govt and Community Services
  /    \     Brisbane, Queensland via Canberra, Australia
 /      \    

/ / \ The opinions expressed above were forcibly implanted in my head \ / / / by aliens from Alpha Zeltex 4, during a recent Invasion attempt.  \/ / / /
  \/ / /     MACINTOSH      : If you need a manual to operate it, it wasn't
   \/ /      SOFTWARE AXIOM : designed properly in the first place !!!!
    \/ Received on Fri May 28 1993 - 01:27:29 CEST

Original text of this message