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

ID: Q89235

The information in this article applies to:

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:

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

Last Reviewed: June 27, 1995