PRB: Screen Program (.SPR) May Run Itself in FoxPro

Last reviewed: June 27, 1995
Article ID: Q89235
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, and 2.5a
  • Microsoft FoxPro for Windows, versions 2.5 and 2.5a

SYMPTOMS

If a screen program (.SPR) contains a DO command that invokes a program with the same name as the screen program and the extension is not specified, the screen program will invoke itself. This problem may cause the following error messages to appear:

  • Too many READs in effect
  • DO nesting too deep

The same problem occurs if the WHEN clause for the field contains the same code (for example, DO checkit).

CAUSE

If the setup code for the screen contains this code, the "DO nesting too deep" message appears because the maximum of 32 DO commands has been exceeded and the SPR runs itself.

RESOLUTION

Include the extension of the program in the DO command. In the example above, type "DO checkit.prg" in the appropriate code sample. The program then executes correctly.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Use the screen generator to create a new screen.

  2. In the VALID clause for one of the GET fields, type "do checkit" (without the quotation marks).

  3. Generate the screen program as CHECKIT.SPR.

  4. In the Command window, type "modify command checkit". In CHECKIT.PRG, type the following command:

          WAIT WINDOW "I'm doing the PRG"
    

  5. DO the CHECKIT.SPR program.

  6. After exiting the field with the VALID clause five times, the following message is displayed

          Too many READs in effect
    

    because exiting the field invoked the VALID clause, which in turn restarted CHECKIT.SPR and created a new READ level. The error occurs because only five READ clauses can be in effect at any one time.


Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a
KBCategory: kbprg kbprb
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: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.