next up previous contents index
Next: Commands controlling program flow Up: Subroutines and external files Previous: Updating shared external files

Returning from subroutines

 


tex2html_wrap_inline33790 tex2html_wrap_inline33790 Syntax

  1. BD>return : tex2html_wrap_inline33712

  2. BD>return : E tex2html_wrap_inline33712

where E is any equation.

tex2html_wrap_inline33806 tex2html_wrap_inline33806

The RETURN:  command is used to terminate the processing of a macro and return to the place immediately following the place where the last M:  command was issued, or to the keyboard if the last M:  command was issued interactively. You should regard M:  and RETURN:  commands as a matched pair during typical use. The second form of the syntax is used to make the return conditional on the value given by the accompanying equation. The equation is defined to be TRUE if the rounded value of the equation is equal to unity, and FALSE otherwise. If the evaluation of the equation causes an error, then the equation is taken to be true, and a return will be made unless superceded by an extant ONERROR:  instruction.

Commands which might result in diverting program flow (GOTO: , M: , and RETURN: ) must be issued on a separate line; otherwise an error is reported. Hence the following usage is not permitted:

BD>for : i=1,1,2 tex2html_wrap_inline33876 return : tex2html_wrap_inline33712

The return address stack is automatically cleared when a RESTART:  command is issued, but not when a CLEAR:  command is issued.  



David Wooff
Wed Oct 21 15:14:31 BST 1998