Test for a unique index value

Command groupFlag affectedReversibleExecute on clientPlatform(s)
Finding dataYESNONOAll

Syntax

Test for a unique index value
 
on 
field-name

Description

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.

Example

# 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