HomeStartingEnvironmentDBMSVisualPQLProceduresSQLFormsHost/APIIndex
Forms homecontents start chapter top of pagebottom of pagenext page index FORM

FORM

The FORM command specifies the name of the form, the database(s) and tabfile(s) that the form is to access, plus security, options and defaults that apply to the entire form.

Any temporary variables are specified on the FORM command.

The only commands that can precede the FORM command are compiler directive commands.

The last command of a Form Definition must be an ENDFORM command.

Syntax

FORM name
The FORM command is required and the name of the form must be supplied. All other clauses are optional. The following clauses can be specified on the FORM command as required:

AUTO WRITE
DATABASE
TABFILE
DECLARE
MESSAGE
ROOT
USERS
The general clauses can be specified on the FORM command as required.

Example:

FORM EXAMPLE -
     DATABASE COMPANY -
              PASSWORD COMPANY -
              SECURITY * , * -
              PREFIX 'C:\MYFILES\' -
     LABELS 20 -
     DECLARE  INTEGER TOTIN -
              STRING XNAME-
     ROOT MAINMENU

This example specifies that the database is COMPANY, password COMPANY in a directory C:\MYFILES\.

The SECURITY clause is specified as asterisks which means that users are prompted to enter read and write passwords when they run the form. If the passwords are coded on the FORM command, anyone can use the form without knowing the passwords.

The LABELS 20 clause specifies that the first 20 characters of any value labels defined in the database schema are displayed together with the field.

The DECLARE clause defines all temporary variables used in the form. Temporary variables can be referenced on any screen.

The ROOT clause declares the name of the first screen to display when execution begins, in this case MAINMENU.

homecontents start chapter top of pagebottom of pagenext page index

AUTO WRITE

[NO]AUTO WRITE
Specifies that any new records are written to the database without asking for confirmation.

NOAUTO WRITE specifies that the user is asked to confirm that the record should be written. NOAUTO WRITE is the default.

homecontents start chapter top of pagebottom of pagenext page index

DATABASE

DATABASE name
         PASSWORD password [SECURE]
         SECURITY rpassword, wpassword [SECURE]
         PREFIX  'prefix' [SECURE]
         READ | WRITE
Multiple SIR/XS databases can be accessed by a form. A separate database clause is required for each database to be accessed. The database name must be specified. The other information may be specified as part of this clause, on the execution statement, or be prompted for interactively at run time.

PASSWORD

SECURITY
PREFIX

SECURE
READ | WRITE

The following example specifies access to the COMPANY database with secure passwords:

DATABASE  COMPANY -
          PASSWORD COMPANY SECURE -
          SECURITY HIGH, HIGH SECURE

homecontents start chapter top of pagebottom of pagenext page index

TABFILE

TABFILE name
        FILENAME 'filename'
        IDENT group/password.user/password
        READ | WRITE
Multiple tabfiles can be accessed by a form. A separate tabfile clause is required for each tabfile to be accessed. The tabfile name is the only required clause.

FILENAME

IDENT
READ
WRITE

homecontents start chapter top of pagebottom of pagenext page index

DECLARE

DECLARE STRING  variable,  ....
        REAL    variable,  ....
        INTEGER variable,  ....
DECLARE specifies all the temporary variables used in the form. Temporary variables are global to the entire form and are available for use by any screen in the form. Declare numeric variables as REAL or INTEGER and character variables as STRING. If the temporary variables are displayed on a screen, use the clauses on the FIELD command to specify how the temporary variables are formatted.

Example: To declare the numeric variables CHEM and PRESSURE and the string variable COMPOUND, specify:

DECLARE REAL CHEM PRESSURE -
        STRING COMPOUND
See
Variable Names.

homecontents start chapter top of pagebottom of pagenext page index

MESSAGE

MESSAGE ERROR VIDEO video_options
WARNING VIDEO video_options

The MESSAGE clause establishes the default video options for all error and warning messages. (See
video treatment for the video_options.)

ERROR

WARNING
MESSAGE ERROR VIDEO BOLD

homecontents start chapter top of pagebottom of pagenext page index

ROOT

ROOT screenname [CALL options]
Specifies the name of the screen which is used when execution begins. If ROOT is not specified, the first screen defined in the form is used.

ROOT is a special CALL command and all the CALL options can be specified on the ROOT clause. Since defaults are passed down from one called screen to another, any options set on the ROOT call are in effect for the entire form.

homecontents start chapter top of pagebottom of pagenext page index

USERS

USERS GROUP  name  [/password]
             ACTIVITIES permissions
             INCLUDE name [/password] ...
Specifies the names of the groups allowed to use the form, their passwords and the types of activities they are allowed. If USERS GROUP is specified, everyone using the form must supply a matching group name. SirForms prompts for the relevant group names and passwords before permitting access to the databases and tabfiles. Group names and user names can be supplied on parameters on the execution statement.

If multiple groups access the same form, the USERS GROUP clause controls permissions for specific operations. All activities are controlled at the GROUP level. To identify a number of different users within a group, use the INCLUDE clause. This means that more information has to be supplied in order to be recognised as a member of this group. If you specify a group name, password, and a user name and password, the user has to supply four names before being allowed to access the form.

The keyword USERS is only specified once, regardless of the number of GROUP names specified.

GROUP

ACTIVITIES

INCLUDE
Example: To define two groups, LOOK with members Anne and Alan and DO with members Betty and Bob, where LOOK is restricted to read access, and DO can do anything, specify:
USERS GROUP LOOK ACTIVITIES READ NOWRITE -
            INCLUDE ANNE, ALAN  -
      GROUP DO   ACTIVITIES ALL -
            INCLUDE BETTY BOB

homecontents start chapter top of pagebottom of pagenext page index