BUG: Nested Constant Not Evaluated Correctly

Last reviewed: May 16, 1996
Article ID: Q123455
The information in this article applies to:
  • Microsoft FoxPro for Macintosh, version 2.6a

SYMPTOMS

Nesting a reference to a constant within a program can cause a "Variable <variablename> not found" error.

RESOLUTION

There are two possible resolutions to this error:

  1. Use parentheses () instead of square brackets [] to specify the array element. For example, change the line:

          table[rows[DNINDEX], 3]
    

    to:

          table(rows(DNINDEX), 3)
    

  2. Use a variable instead of a constant when square brackets are required. For example, change:

          #DEFINE DNINDEX 2
    

    to:

          DNINDEX = 2
    

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

  1. Create a program containing the following lines of code:

    #DEFINE DNINDEX 2 DIMENSION table[2, 3] DIMENSION rows[2]

    rows[1] = 1 rows[2] = DNINDEX

    table[rows[dnIndex], 3] = "abc"

  2. Run the program. The error will occur.


Additional reference words: fixlist3.00b VFoxMac FoxMac 2.60a buglist2.60a
KBCategory: kbprg kbfixlist kbbuglist
KBSubcategory: FxprgGeneral


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 16, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.