Understanding the RETURN CommandLast reviewed: April 30, 1996Article ID: Q119900 |
The information in this article applies to:
SUMMARYThe RETURN command provides a great deal of flexibility over program control. RETURN terminates execution of a program, procedure, or function. Depending on how RETURN is used, control is returned to the calling program, the highest-level calling program, another program, or the Command window. The sample code below illustrates the power of the RETURN command.
MORE INFORMATIONEnter the following code in a program call RETTEST.PRG:
PARAMETER x && line 1 ON ERROR DO myErr DO A WAIT WINDOW 'In master' && line 5 ON ERROR PROCEDURE A DO B WAIT WINDOW 'In A' && line 11 PROCEDURE B x=testing WAIT WINDOW 'In B' && line 15 PROCEDURE myErr DO CASE CASE x = 'master' RETURN TO MASTER CASE EMPTY(x) RETURN OTHERWISE RETURN TO &x ENDCASETo demonstrate the capabilities of the RETURN command, try the following three invocations of the above program from the Command window.
REFERENCESFoxPro "Language Reference"
|
Additional reference words: VFoxWin 3.00 FoxUnix FoxMac FoxDos FoxWin 2.50
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |