FIX: Using an Array Element as the Counter in a For Loop FailsID: Q147277 2.60 2.60a 3.00 3.00b WINDOWS kbprg kbbuglist kbfixlist The information in this article applies to:
SYMPTOMSIn FoxPro and Visual FoxPro, attempting to use an array element as the counter variable in a FOR...ENDFOR command results in the error, "Not a numeric expression." If the array hasn't been declared, you may receive the error, "Variable not found."
WORKAROUNDUse a memory variable instead of an array element.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0 for Windows.
MORE INFORMATIONAccording to the FoxPro and Visual FoxPro language reference, you should be able to use an array element as the counter variable in a FOR...ENDFOR Command.
Steps to Reproduce ProblemType the following code into a program file:
When you run this program you will receive the error, "Not a numeric
expression." If you replace aTest[1] with nMyVar in the FOR statement it
will work correctly.
KBCategory: kbprg kbbuglist kbfixlist KBSubcategory: FxprgGeneral VFoxWin buglist2.60 buglist2.60a buglist3.00 buglist3.00b fixlist5.00 Additional reference words: 2.60 2.60a 3.00 3.00b
|
Last Reviewed: February 23, 1997 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |