Enhancement to Form.GEN

     The latest version of Form.GEN, is now available from the
     Ashton-Tate Software Support Center through any of our
     On-line Services.  It includes a new, previously
     undocumented feature which allows advanced data validation
     through the addition of a user-defined popup picklist of
     valid choices for up to nine fields in your database (eight
     with a Catalog open). This new feature provides a means of
     forcing the user to enter valid data for that field.  
     
     The popup picklist is an extension of the Accept value when
     option of the Fields:Modify:Edit Options menu.  If the data
     entered by the user into a field utilizing the popup
     validation option does not find a match in an associated
     "picklist" database, a popup picklist appears.  The popup
     displays the current invalid value of the field and provides
     a list from which the user may select a valid entry as a
     replacement value. 
     
     This picklist feature is especially important for data entry
     when two or more files are related.  The parent file in the
     relation can be used as the picklist database to insure that
     every key added to the child file has a corresponding record
     in the parent.  
     
     To use this feature you must first create a database that
     contains each of the valid responses for the field.  The
     easiest way to create this picklist database is to USE the
     main database, index it on the field in question using the
     UNIQUE clause, then type   
     
        COPY TO <picklist file> FOR FIELDS <fieldname>  
     
     USE the file and LIST it to make sure all the valid choices
     for that field are there.  You may add choices to this list
     at any time.  If, in the future, you decide to remove a
     choice from the list, keep in mind that this picklist
     database defines the valid choices for the field. 
     Consequently, if a choice is removed from the picklist
     database, any records using that value in the main database
     will be flagged as invalid when encountered by your new
     Form.GEN routine. (see restriction #2).
     
     Next, you must index the picklist database to an .MDX tag
     with the following command:  
     
        INDEX ON <fieldname> TAG <tagname>  
     
     Once the picklist database has been created and indexed,
     there is no need to open it again; it will be automatically
     opened in workarea 2 when you open the format file (if there
     are other files open in other workareas, this procedure may
     close them as needed).  If you have picklists defined for
     more than one field, each will be opened in a subsequent
     workarea (see restriction #6).
     
     Create your format screen just as you normally would.  All
     other features of the new Form.GEN are identical to the
     original Form.GEN.  Select the field which will use the
     picklist and choose Accept value when from the Fields:Modify
     field:Edit options menu.  Specify the picklist with the
     following syntax:
     
        "POPUP" = "<picklist file> -> <fieldname> ORDER <tagname>
     [REQ]"  
     
     Include the quotes here; they are important.  The optional
     REQ clause specifies that the user must make a choice from
     the picklist.  If the REQ is missing, the user may press
     escape to exit the picklist, remove the entry and go on,
     leaving the field blank.
     
     EXAMPLE:
     
        USE Customer
        COPY TO Clast FIELDS C_Last
        USE Clast
        INDEX ON C_Last TAG Clastx
        USE Customer
     
     Create the screen format and enter the following command
     under Fields:Modify field:Edit options:Accept value when:
     
        "POPUP" = "Clast->C_Last ORDER Clastx REQ"
     
     Now save the format file.  That's it.  You can test your new
     format routine by entering invalid data into the picklist
     field.
     
     * Warning *  some restrictions apply:  
     
     1)  This feature cannot be used on a field designated as
     multiple choice.  
     
     2)  Records containing invalid data for the field may still
     be entered  into the file if EDITed or APPENDed without the
     form file open.  If invalid data has been entered into the
     database, it will be flagged as invalid if subsequently
     edited using a form file with a picklist defined for that
     field.  
     
     3)  If BROWSE is used in conjunction with a picklist form
     file, attempts to edit the restricted field will result in
     an "Invalid function" error.  
     
     4) If this feature is called from a program that has an open
     procedure file, it will be closed by Form.GEN and will need
     to be reopened by the program.  Form.GEN does not restore
     the environment after execution.  
     
     5) Form.GEN creates memory variables based on the first 6
     characters  of the fieldname.  If picklists are defined for
     two or more  fields, make sure the first six characters of
     their fieldnames  are  unique.  
     
     6) This feature uses work areas 2 through 10, depending on
     how many picklists are defined.  Any open databases in those
     areas will be closed.
