Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- ClipOn 3.0 Reference - c_uniquekey() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 C_UNIQUEKEY()

 DESCRIPTION

 C_UNIQUEKEY() determines the number of occurrences a given key
 appears in the index file of a database.  This can be used to
 obtain the number of occurrences of a key in the index or to
 determine if the key is unique.

 NOTES

 C_UNIQUEKEY() will save the currently selected database and record
 position and restore it before exiting.

 SYNTAX

 C_UNIQUEKEY(key [,dbf])

 PARAMETERS

 key (C) is the index key value to check.

 dbf (C) is the database alias name to search.  If dbf is not specified,
 the currently selected database is searched.

 RETURNS

 C_UNIQUEKEY() returns the number of occurrences found for the
 specified index key, or zero (0) if no occurrences were found.

 EXAMPLES

 && This allows the user to enter an account code, which must be unique.
 && C_UNIQUEKEY() is used to quickly check for a unique key.

 select 0
 use acctcode

 m1 = space(20)
 do while .t.
   @ 1,1 say "Enter Unique Account Code: " get m1
   read
   if !c_uniquekey(m1)
     ? "Account Code Must be Unique, Please Reenter"
     loop
   endif
   exit
 enddo


See Also: C_SEARCH() C_ASEARCH()

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