BUG: KEYMATCH() Returns Inconsistent Results or Error Msg

Last reviewed: February 16, 1996
Article ID: Q117568
The information in this article applies to:
  • Microsoft FoxPro for Windows, version 2.6
  • Microsoft FoxPro for MS-DOS, version 2.6

SYMPTOMS

The KEYMATCH() function returns different results, depending on the order of the commands issued.

STATUS

Microsoft has confirmed this to be a problem in FoxPro 2.6 for Windows and FoxPro 2.6 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

  1. Load FoxPro.

  2. Copy the following code into a program:

         CLEAR ALL
         CLEAR
         CREATE TABLE people (pID C(5), pNAME C(10), pCITY C(10))
         APPEND BLANK
         REPLACE pID WITH 'A1234'
         REPLACE pNAME WITH 'Mickey'
         REPLACE pCITY WITH 'Bellevue'
         INDEX ON pID TAG id
         INDEX ON pNAME TAG name
    

         ? KEYMATCH('A1234','PEOPLE')    && Invalid function argument...
         ? KEYMATCH('A1234','PEOPLE',1)  && .T.
         ? KEYMATCH('A1234','PEOPLE',2)  && .F.
         ? KEYMATCH('A1234','PEOPLE')    && .F. instead of "Invalid..."
         ? KEYMATCH('Mickey','PEOPLE',2) && .T.
         ? KEYMATCH('A1234','PEOPLE')    && .F. instead of "Invalid..."
    
    

  3. Run the program.

When the "Invalid function argument, type, or count" error message occurs on the first ? KEYMATCH('A1234','PEOPLE') command, choose the Ignore button.

Note that the second and third issuances of the same command return a .F. (FALSE) value instead of the "Invalid function argument, type, or count" error message.

If you put the KEYMATCH() commands in the following order

     ? KEYMATCH('A1234','PEOPLE')    && Invalid function argument....
     ? KEYMATCH('A1234','PEOPLE',2)  && .F.
     ? KEYMATCH('A1234','PEOPLE',1)  && .T.
     ? KEYMATCH('A1234','PEOPLE')    && .T. instead of "Invalid..."
     ? KEYMATCH('Mickey','PEOPLE',2) && .T.
     ? KEYMATCH('A1234','PEOPLE')    && .F. instead of "Invalid..."

the first ? KEYMATCH('A1234','PEOPLE') command returns the "Invalid function argument, type, or count" error message, the second issuance of the same command returns .T. (TRUE), and the third issuance of the same command returns .F. (FALSE).


Additional reference words: FoxDos FoxWin 2.60 errmsg err msg buglist2.60
KBCategory: kbprg kbbuglist
KBSubcategory: FxprgGeneral


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 16, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.