Difference between revisions of "KEYMATCH()"

From Recital Documentation Wiki
Jump to: navigation, search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Class==
 
Indexing
 
 
 
 
==Purpose==
 
==Purpose==
 
Function to determine whether a specified key value already exists
 
Function to determine whether a specified key value already exists
Line 12: Line 8:
  
 
==See Also==
 
==See Also==
[[@...GET]], [[CREATE]], [[DISPLAY STATUS]], [[INDEX]], [[LIST STATUS]], [[MODIFY STRUCTURE]], [[SET ORDER]]
+
[[@...GET]], [[CREATE]], [[DISPLAY STATUS]], [[FIND]], [[INDEX]], [[LIST STATUS]], [[MODIFY STRUCTURE]], [[REFERENCES()]], [[SEEK]], [[SEEK()]], [[SET DELETED]], [[SET ORDER]]
  
  
Line 33: Line 29:
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Category:Indexing]]
 +
[[Category:Indexing Functions]]

Latest revision as of 16:48, 2 December 2009

Purpose

Function to determine whether a specified key value already exists


Syntax

KEYMATCH(<exp> [<index number>[,<workarea>]])


See Also

@...GET, CREATE, DISPLAY STATUS, FIND, INDEX, LIST STATUS, MODIFY STRUCTURE, REFERENCES(), SEEK, SEEK(), SET DELETED, SET ORDER


Description

The KEYMATCH() function returns TRUE (.T.) if the specified key value <exp> exists in an open index. The KEYMATCH() function will search the current ndx (single index) file, or the controlling tag of a dbx (multiple index) file, unless the number of another index file is specified. The optional <index number> clause can contain the number of an ndx file in a list of open indexes, or the number of a tag in an open .dbx file. If you are specifying a tag in a dbx file other than the currently active dbx file, you must specify the dbx file name and then the tag number.

Index numbers can be listed using the DISPLAY | LIST STATUS command. The optional <workarea> clause is used to check indexes in other workareas. When using the <workarea> clause, the <index number> clause must also be used.

KEYMATCH() ignores the SET DELETED ON|OFF set command and always takes records marked for deletion into account when determining whether the key value exists. This ensures that subsequent recalling of deleted records does not compromise the integrity of unique index keys.


Example

m_val=part_no
if keymatch(m_val)
    dialog box "This part number already exists!"
endif


Products

Recital Server, Recital