To define a file condition
-
On the File Definition form of the Database Definition
tool, press Define (F6) and choose
Conditions.
The File Condition Definition form appears.
-
If the file has conditions, press Insert (F8) or select a blank line to add a new condition.
To change a condition, select the condition and press Define (F6). The Condition Definition subform appears, with the cursor located immediately after the word "When."
- Press Select (F4) and choose no parentheses, one parenthesis, or two parentheses for the Left Parenthesis field.
- Move to the First Operand field.
-
Press Select (F4) and choose one of the following options.
Choose To Field Select a field as the first operand. You can select a field from the primary file or from a file that has a one-to-one relation from the primary file. Relation Define a relation check condition, which is a condition that lets a program access a field or record only after verifying that a selected relation does, or does not, exist. A relation check condition is valid only in relation and rule conditions. After selecting the first operand, you can define a field operator. For details, refer to the procedure for using an old value of a field in a condition.
- Move to the Operator field.
-
Press Select (F4) and choose one of the following operators: =, ≠, >, ≥, <,
or ≤.
Note: For a relation check condition, select Exist(s) or Do(es) Not Exist.
- Move to the Second Operand field.
-
Press Select (F4) and choose one of the following options.
Choose To Field Define a field. The field must be the same type and size as the first operand. Value Define a constant value. Type a value and press Enter. The value must be the same type and no larger than the size of the first operand. Current Date Use the current date in the condition. This option is valid only if the first operand is a date field. Current Time Use the current time in the condition. This option is valid only if the first operand is a time field. Note: A relation check does not have a second operand. - Move to the Right Parenthesis field.
-
Press Select (F4) and choose no parentheses, one parenthesis, or two parentheses.
Each parenthesis in the Right Parenthesis field must match up with a parenthesis in the Left Parenthesis field.
-
Press Enter twice
to save the condition.
If you want to define more conditional statements for this condition, refer to the procedure for defining multiple conditional statements.
- If the condition is new, the Condition Name subform appears. Type a name for the condition and press Enter.