FIX: #REGION Directive Not Behaving Properly in FoxPro 2.6x

Last reviewed: October 20, 1997
Article ID: Q117352
2.6x    | 2.6x
WINDOWS | MS-DOS kbenv kbprg kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft FoxPro for Windows, versions 2.6x
  • Microsoft FoxPro for MS-DOS, versions 2.6x

SYMPTOMS

If you use the #REGION compiler directive in conjunction with the REGIONAL command in order to use a variable that has the same name but has different values in a single screen, the #REGION directive does not work correctly.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual FoxPro 3.0 for Windows.

MORE INFORMATION

The REGIONAL command creates regional memory variables and arrays. Memory variables or arrays with identical names can be created without interfering with each other when their values are protected within a "region." Regional variables are similar to private variables.

Regional variables are declared before they are used in a screen. A region (0 through 31) is created with the #REGION compiler directive. Then the command REGIONAL <variable name> is used after the #REGION directive.

Steps to Reproduce Problem

  1. Place the following code in the Setup code section of a screen:

          #REGION 1
          REGIONAL abc
          abc = "This is region 1."
    

          #REGION 2
          REGIONAL abc
          abc = "This is region 2."
    

  2. Create a push button with the following code in the VALID clause:

          #REGION 1
          WAIT WINDOW abc
    

  3. Create another push button with the following code in the VALID clause:

          #REGION 2
          WAIT WINDOW abc
    

When you click the first push button, the text "This is region 1." should appear. Instead, the text "This is region 2." appears because GENSCRN does not generate the #REGION directives properly--the variable "abc" is recognized only once with the text that was assigned to it last. The same code works correctly in FoxPro version 2.5 for Windows and MS-DOS.


Additional reference words: FoxDos FoxWin VFoxWin 2.60 2.60a fixlist3.00
buglist2.60 buglist2.60a
KBCategory: kbenv kbprg kbfixlist kbbuglist
KBSubcategory: FxtoolSbuilder
Keywords : FxtoolSbuilder kbbuglist kbenv kbfixlist kbprg
Version : 2.6x | 2.6x
Platform : MS-DOS WINDOWS
Solution Type : kbfix


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: October 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.