Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Artful Two for Clipper 5.0 - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

Syntax

UNIQUE( ptarget[, nKey_no,[ cTable[, lNew ]]] )

Purpose

Prevent duplicate records in a table.

Arguments

     pTarget -- item to check

     nKey_no -- index key number; defaults to current index

     cTable -- alias of table to check; defaults to current table

     lNew -- if passed and .T., indicates that a new record is being
             appended; else a record edit is assumed

Setup

cTable is open and indexed appropriately. pTarget must correspond to the
index specified by nKey_no.

Example

a function to obtain the key fields, for use inside GET_STD2().
The Customer file is selected....

     @ 10, 10 GET mAccount_no PICTURE "@9" VALID ;
              UNIQUE( mAccount_no, ;
                      GET_ORDER("Account_no"), ;
                      .F., ;
                      is_append )

Returns

.T. if pTarget is unique in cTable, else .F.

Side Effects

Crash on bad data.

Artful Calls

POP_MSG

Source File

AA_UNIQ.PRG

See Also: NEXT()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson