# BUG: Nested Constant Not Evaluated Correctly

ID: Q123455

2.60a MACINTOSH kbprg kbbuglist

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

    Keywords          : FxprgGeneral kbbuglist kbfixlist
    Version           : 2.60a
    Platform          : MACINTOSH

Last Reviewed: May 18, 1996 © 1999 Microsoft Corporation. All rights reserved. Terms of Use.