|
Forms | FORM |
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
AUTO WRITE
Example:
The
The
The
The
Example: To declare the numeric variables 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:
DATABASE
TABFILE
DECLARE
MESSAGE
ROOT
USERS
The general clauses
can be specified on the FORM
command as required.
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\.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.LABELS 20
clause specifies that the first 20 characters of
any value labels defined in the database schema are displayed together with the
field.DECLARE
clause defines all temporary variables used in the
form. Temporary variables can be referenced on any screen.ROOT
clause declares the name of the first screen to
display when execution begins, in this case MAINMENU. 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. 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.Specifies the database password. If this clause is omitted, the
password is taken as blank. An "*" specifies that the password is
prompted for when the form is compiled.
SECURITY
Specifies the database read and write security passwords. Specify
the read password first, then the write password separated by a comma. If this
clause is omitted, the passwords are taken as blank. An "*" specifies
that the password is prompted for when the form is compiled.
PREFIX
Specifies the directory path where the database is located if it is
not in the current database directory. Omitting the clause
or specifying an "*", specifies that the database is in
the database directory. This is the current directory
or the directory set with the
PREFIX
execution
parameter.SECURE
SECURE
specifies that the PASSWORD,
SECURITY,
or PREFIX
supplied are used only for
compilation. When the compiled form is
executed, the database directory is used. This is the current directory
or the directory set with the PREFIX
execution
parameter.READ | WRITE
READ specifies that the database is opened for read-only access
so others can share access to the database without using
MASTER.
WRITE specifies that the database is opened for read
and write operations and is the default.
The following example specifies access to the COMPANY database with secure
passwords:
DATABASE COMPANY -
PASSWORD COMPANY SECURE -
SECURITY HIGH, HIGH SECURE
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.Specifies the operating system file name of the tabfile. The default
filename is the name of the tabfile.
IDENT
Specifies a user group, user and passwords. See
tabfiles
for details on the security aspects
of user groups and users on tabfiles.
READ
Specifies that the tabfile is opened for read-only access. This
allows shared access to the tabfile.
WRITE
Specifies that the tabfile is opened for read and write operations.
This is the default.
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.CHEM
and PRESSURE
and the string variable
COMPOUND
, specify:
DECLARE REAL CHEM PRESSURE -
STRING COMPOUND
See Variable Names.
MESSAGE ERROR VIDEO video_options
WARNING
VIDEO video_options
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
ROOT screenname [CALL options]
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.
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
FORM
command cannot be reinstated at a lower level.INCLUDE
INCLUDE
clause. However, the user must still supply the group
name and permissions are set at the group level.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