BUG: RETURN TO <Filename>.SPR Does Not Work in .APPs or .EXEs

Last reviewed: February 16, 1996
Article ID: Q121685
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5x, 2.6, 2.6a

SYMPTOMS

The RETURN TO <filename>.SPR command does not work if it is executed within an .APP or .EXE file.

WORKAROUND

The RETURN TO <filename>.SPR command will work if it is changed to RETURN TO <filename>.PRG. However, this method has a drawback: Every time you modify and regenerate your screen (.SCX), you have to issue the RENAME command to rename the newly generated screen to a .PRG file.

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

Steps to Reproduce Problem

  1. In the FoxPro Command window, issue the following command:

    MODIFY COMMAND MAIN

  2. Type the following code in MAIN.PRG and save it:

    ON ERROR DO errhand WITH ERROR( )

       DO test.spr    && GET field should cause an error
    
       PROCEDURE errhand
       PARAMETER merror
       WAIT WINDOW "Error occured: "+STR(merror)
       RETURN TO test.spr
    
    

  3. In the FoxPro Command window, issue the following command:

    CREATE SCREEN TEST

  4. Add an input field with M.CHOICE in the Input text box and the following code in the VALID clause:

    IF !EMPTY(m.choice)

          WAIT WINDOW "Something in field" && cause error to occur
    
    ENDIF

  5. Add a push button with OK as the prompt and the Terminate READ On Selection option selected. Enter any variable in the Variable text box.

  6. Save the screen.

  7. In the FoxPro Command window, issue the following command:

    CREATE PROJECT MYTEST

  8. Click the Add button to add MAIN.PRG as a Program type. FoxPro automatically mark MAIN.PRG as the main program.

  9. Click the Add button again to add TEST.SCX as a Screen type.

  10. Build an application called MYTEST.APP.

  11. Run MYTEST.APP.

  12. Type "123" (without the quotation marks) in the input field on the screen and press ENTER.

    Note that a WAIT window containing the text "Error occured: 16" will be displayed in the top-right corner. Press any key. RETURN TO TEST.SPR in the error routine will return to the Command window instead of to the OK button.

  13. Run MAIN.PRG.

  14. Repeat step 13.

Note that RETURN TO TEST.SPR returns to the OK button on the screen. The READ is still active.


Additional reference words: FoxWin buglist2.50 buglist2.50a buglist2.50b
buglist2.60 buglist2.60a 2.50 2.50a 2.50b 2.60 2.60a
KBCategory: kbprg kbbuglist
KBSubcategory: FxtoolGeneral


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: February 16, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.