PRB: KEYMATCH Ignores SET DELETED and SET FILTER SettingsID: Q125791 The information in this article applies to:
SYMPTOMSThe KEYMATCH() function added to FoxPro in versions 2.6 and later does not adhere to the settings of SET DELETED or SET FILTER.
CAUSEThe FoxPro versions 2.6 and 2.6a for Windows style help file states that KEYMATCH(); "Searches an index file or index tag for an index key and returns true (.T.) if the index key is found." The SET FILTER and SET DELETED commands only affect the table, not the index. Therefore, KEYMATCH() will not adhere to these settings.
RESOLUTIONFor KEYMATCH() to acknowledge the settings of SET DELETED or SET FILTER, place the FILTER expression and DELETED setting in the index itself. For Example, unless the same conditions of the SET FILTER expression and SET DELETED ON are added to the index, the following code will not give the desired results using the KEYMATCH() function. This example is set up to return a .T. using the Customer table where the record is not deleted, and the State is WA or NC:
KEYMATCH()returns a .F., no match was found.
For the above example to return a .T., place the DELETED and FILTER conditions within the FOR clause of the Index expression as in this example:
These changes allow KEYMATCH() to recognize if the records have been marked
for Deletion and meet the FILTER (STATE="WA" OR STATE="NC") setting.
STATUSThis behavior is by design. Additional reference words: FoxDos FoxWin 2.60 2.60a FOXHELP.DBF FOXHELP.HLP KBCategory: kbprg kbprb KBSubcategory: FxprgGeneral |
|
Last Reviewed: June 27, 1995 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |