PRB: "Variable Not Found" Error Occurs with Filter ExpressionID: Q119898 The information in this article applies to:
SYMPTOMSWhen you are performing a SEEK, a LOCATE, or a FIND, the following error message occurs:
CAUSEA filter expression has been set, and it uses the variable that can no longer be found. When the filter expression is reevaluated during the search, FoxPro reports that the variable cannot be found.
RESOLUTIONWhile every case is likely to be different, the problem illustrated below could be resolved in one of the following ways: 1. Make the variable used in the filter expression PUBLIC.
2. Change the SetFilter procedure to the following:
In the second case, the use of macro substitution eliminates the dependency
of the filter upon the variable.
MORE INFORMATION
Steps to Reproduce Behavior1. Enter the following code in a program:
2. Run the program.
In the code above, the error occurs because the variable used in the filter expression loses its scope when the SetFilter procedure terminates. FoxPro senses this and clears the filter because it is no longer valid. Additional reference words: FoxUnix FoxMac FoxDos FoxWin 2.00 2.50 2.50a 2.50b 2.50c 2.60 2.60a KBCategory: kbprg kberrmsg kbprb KBSubcategory: FxprgMacrosub |
|
Last Reviewed: June 27, 1995 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |