
/****************************************************************************/

/*  Module PNLFVALC.C 

    Copyright 1986 Roundhill Computer Systems Limited
    All rights reserved

    Use and disclosure of this code are prohibited unless in accordance
    with the terms of the PANEL software licence.

    ************************************************************************
    *** THE OBJECT CODE VERSION OF THIS MODULE IS INCLUDED IN THE PANEL  ***
    *** LIBRARY.  IF YOU AMEND AND COMPILE THIS MODULE AND LINK IT WITH  ***
    *** YOUR APPLICATION IT WILL SUPERSEDE THE LIBRARY VERSION.          ***
    ************************************************************************

    PANEL:  Type 4          : Field Validation
            Source Language : C

    Modification History (Push-Down List):  

            28.12.85        : Convert to table-driven operation

******************************************************************************/

#include <pnli.h>
#include <pnlc.h>

extern int (*PAFVTB[])();   /* field validation function table */
extern int PAFVPM;          /* max index into function table */

/*****************************************************************************/

int PAFVAL(res)

/*  PAFVAL does field validation on a complete field.  It is designed so that
    you can determine the route through a panel by reference to the entry in
    each field.  You may use but not modify PAFLX and PACRF (which contains
    the fcb for the field just read).  'res' is the 'result' of the last
    field read.

    The function should return zero if the route is not to be modified, and
    the field number to jump to otherwise.  For example, you could arrange
    to test for a particular line validaton number (in PACRF.linevaln) and 
    then look at the data (at PACRF.datablock) and skip the next field if 
    a particular value is found (return PAFLX+2).

    As delivered, the only function table entry is a dummy which returns 
    zero.  Modify the PAVPTC.C module defining validation pointer tables if
    you wish to add functions here (such as HP150 touch screen support).

******************************************************************************/

int res;

{
    return (*PAFVTB[0])(res);  
}
