Microsoft KB Archive/106696

From BetaArchive Wiki

Single Screen Set to Prevent "Too Many READs in Effect"

ID: Q106696

2.50 2.50a 2.50b | 2.00 2.50 2.50a 2.50b

WINDOWS               | MS-DOS

The information in this article applies to:

  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, 2.5b

SUMMARY

If a screen runs another screen, the current number of READs in effect is increased by one. One way to avoid nesting is to have all the screens that call each other in one screen set where only one screen is enabled at a time.

MORE INFORMATION

The following procedure creates a set of screens that can run one another without increasing READ levels by enabling and disabling GETs:

 1. Create a new project and name it ONESCRN.

 2. Add a new screen to the project and name it ONE.

 3. Change the screen type to a window.

 4. Name the window One and title the window Screen 1.

 5. Create a SAY object with "RDLEVEL()" as the expression.

 6. Create two push buttons. Enter "Screen 2" and "Quit" as the
    push button prompts, and enter "X" in the Variable text box.

 7. Enter the following code in the Valid Code Snippet:

       DO CASE
          CASE x = 1
             SHOW GETS WINDOW one DISABLED
             SHOW GETS WINDOW two ENABLED
          CASE x = 2
             CLEAR READ
       ENDCASE

 8. Save the screen without saving the environment.

 9. Save the screen again as TWO.

10. Change the window name to Two and the window title to Screen 2. 11. Select the push buttons created in step 6.

12. Change the first push button prompt to Screen 1.

13. Change the code in the Valid Code Snippet as follows:

       DO CASE
          CASE y = 1
             SHOW GETS WINDOW two DISABLED
             SHOW GETS WINDOW one ENABLED
          CASE y = 2
             CLEAR READ
       ENDCASE

14. Name the window Two and title the window Screen 2. 15. Save the screen.

16. Add the screen TWO.SCX to the screen set One in the project.

17. Build the project with the Rebuild Project option.

18. Run the ONE.SPR program.

Note that the RDLEVEL() command never returns a value greater than 1, even when you are switching between screens 1 and 2.

For additional information about this topic, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q106697
   TITLE     : How to Prevent "Too Many READs in Effect" Error Message

The method described in Q106697 is faster, but requires more memory and more resources. Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a 2.50b errmsg err msg Window Screen switch KBCategory: KBSubcategory: FxenvMemory

Keywords          : kberrmsg FxenvMemory 
Version           : 2.50 2.50a 2.50b | 2.00 2.50 2.5
Platform          : MS-DOS WINDOWS

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