| 20% Command group | 20% Flag affected | 20% Reversible | 20% Execute on client | 20% Platform(s) |
|---|---|---|---|---|
| Finding data | YES | NO | NO | All |
Test for a unique index value on field-name
This command tests the specified indexed field for a unique value. The flag is set if the current field value is a unique index value, and cleared if the value duplicates an existing index value. In a multi-user situation, no account is made of field values in records held by other work stations which are not yet updated to disk.
You use Test for a unique index value before storing a new value in a file. In the following example, the proposed new part number is tested against the existing file.
# Insert account AC05 if it does not already exist
Set main file {fAccounts}
Prepare for insert
Calculate fAccounts.Code as 'AC05'
Test for a unique index value on fAccounts.Code
If flag true
Update files
End If