Formonly fields

FORMONLY form fields are not associated with columns of any database schema.

Syntax

item-type item-tag = FORMONLY.field
   [ TYPE
      { LIKE [table.]column
      | datatype [NOT NULL] }
   ] 
     [ , attribute-list ]  ;
  1. table is the name or alias of a table, synonym, or view, as declared in the TABLES section.
  2. column is the unqualified SQL identifier of a database column.
  3. field is the identifier that will be used in programs to handle the field.
  4. datatype is any data type definition. When no data type is specified, the default is CHAR.

Usage

Form fields defined with the FORMONLY prefix define fields explicitly with data type and attributes, and are not associated to any database column definition in a schema file. Like regular form fields associated to a database column, they can be used to enter or display the values of program variables.

If the SCHEMA section specifies FORMONLY, this is the only kind of form field description allowed in the ATTRIBUTES section.

The optional data type specification uses a restricted subset of the data type declaration syntax that the DEFINE statement supports. When using CHAR or VARCHAR data types, you do not have to specify the length, because it is defined by the size of the field tag in the LAYOUT section.

Specifying a data type followed by the NOT NULL keywords is equivalent to the NOT NULL attribute.

The STRING data type is not supported in FORMONLY form field definitions.

When using the LIKE [table.]column syntax, the form field will get the data type of the specific table column as defined in the .sch database schema file. The table name must be specified in the TABLES section.

The definition of FORMONLY fields can be completed by using the DISPLAY LIKE and VALIDATE LIKE attributes, to get the display and validation attributes from the .att and .val database schema files.

EDIT f001 = FORMONLY.total TYPE DECIMAL(10,2), NOENTRY ;
EDIT f002 = FORMONLY.total TYPE LIKE customer.cust_name,
              VALIDATE LIKE customer.cust_name ;