How the EVALUATE() Function WorksID: Q113172 The information in this article applies to:
SUMMARYThe EVALUATE() function evaluates the expression contained within the parentheses and returns the result. However, the EVALUATE() function produces different results based on the exact syntax of the statement.
MORE INFORMATIONThe EVALUATE() function returns different values based on whether quotation marks ("") are placed around the expression being evaluated. Enclosing the expression within quotation marks causes EVALUATE() to return the literal value of the expression. However, if no quotation marks are used, the command returns the value stored in the expression. To demonstrate this behavior, type the following in the Command window:
As you can see, quotation marks determine what value the EVALUATE()
function returns. With the quotation marks, EVALUATE() returns the literal
value of the expression; in this case, "Level1". Without the quotation
marks, EVALUATE() returns the value contained within the expression being
evaluated; in this case, "Level2".
Since the function returns quite different values based on its syntax, it may cause various error messages to appear, depending on the program's code. For example, the following code returns the error "Index Does Not Match Database File. Recreate Index":
Since the EVALUATE() function in this example does not contain quotation
marks around the variable "ord", the literal value "company" is not
returned. Instead, EVALUATE(ord) returns the value of the COMPANY field
of the current record, which causes the error messages.
REFERENCES"Commands & Functions," version 2.0 (MS-DOS), page C3-356 "Language Reference," version 2.5 (MS-DOS and Windows), page L3-485 "Language Reference," version 2.5 (Macintosh), page 407 Additional reference words: FoxMac FoxDos FoxWin 2.00 2.50 2.50a 2.50b macro substitution KBCategory: kbprg KBSubcategory: FxprgMacrosub |
|
Last Reviewed: June 27, 1995 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |