Microsoft KB Archive/121685

{| = BUG: RETURN TO .SPR Does Not Work in .APPs or .EXEs =
 * width="100%"|

ID: Q121685

2.5x 2.60 2.60a WINDOWS kbprg kbbuglist

The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5x, 2.6, 2.6a

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

WORKAROUND
The RETURN TO .SPR command will work if it is changed to RETURN TO .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.

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 5. 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 6. 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. 7. Save the screen. 8. In the FoxPro Command window, issue the following command:

CREATE PROJECT MYTEST 9. Click the Add button to add MAIN.PRG as a Program type. FoxPro automatically mark MAIN.PRG as the main program. 10. Click the Add button again to add TEST.SCX as a Screen type. 11. Build an application called MYTEST.APP.

12. Run MYTEST.APP.

13. 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. 14. Run MAIN.PRG. 15. 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

Keywords         : FxtoolGeneral kbbuglist Version          : 2.5x 2.60 2.60a Platform         : WINDOWS
 * }