ERR: Not a Numeric ExpressionID: Q120536 2.5x 2.6x 3.00 | 2.00 2.5x 2.6x
The information in this article applies to:
SYMPTOMSYou receive the error message "Not a numeric expression" after any of four types of @ ... GETs: buttons, radio buttons, popups, and list boxes.
CAUSEThe FoxPro for Windows "Developer's Guide" for versions 2.5x and 2.6x states on page B-26 that the error "Not a numeric expression" occurs when "An attempt was made to use the SUM command on a non-numeric field." Another cause for this error message is using a variable that has not been initialized after being declared in a button, radio button, popup, or list box.
RESOLUTIONIf a variable is declared, but not initialized, it contains the value of false (.F.). If you then use this variable as the variable for specific types of @ ... GET commands, you will see the "Not a numeric expression" error when you run the code. The solution is to initialize the variable to a number, or to not declare the variable at all.
MORE INFORMATION
Steps to Reproduce Behavior1. Place the following code in a program called TEST.PRG:
2. Run the program. The "Not a Numeric Expression" error will occur.
3. Choose the Ignore button. The error will occur again for each @ ... GET WorkaroundThere are two ways to resolve this problem:
REFERENCES"Language Reference," version 2.5 (MS-DOS, Windows), pages L3-31 to L3-126 Additional reference words: FoxDos FoxWin VFoxWin 2.00 2.50 2.50a 2.50b 2.60 2.60a 3.00 listbox errmsg KBCategory: KBSubcategory: FxprgGeneral
|
|
Last Reviewed: May 22, 1998 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |