How to Determine If a Variable Exists in MemoryID: Q115990 The information in this article applies to:
SUMMARYIf a nonexistent variable is called in FoxPro, a "Variable <variable name> not found" error message will result. This article explains how you can determine whether a particular variable exists in memory.
MORE INFORMATIONThere are two ways you can determine the existence of a variable.
Method 1The TYPE() function will return a "U" if the variable does not exist in memory. The following sample code illustrates this behavior.
In a program, the TYPE() function could be used in an IF ... ELSE ... ENDIF
scenario, such as:
Method 2Set up an ON ERROR routine that will trap for error number 12 (Variable <variable name> not found). For example:
Additional reference words: FoxMac FoxDos FoxWin 2.00 2.50 2.50a 2.50b 2.60
find
available
found memvar errmsg
KBCategory: kbenv kbprg kberrmsg
KBSubcategory: FxenvMemory
|
|
Last Reviewed: June 27, 1995 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |