RETURN: Return from a Procedure Subroutine



This command tells VISTA that the execution of the current sub-procedure is complete and to return to any calling procedure or to immediate input mode as is appropriate. This command is intended to allow a return from the procedure as a result of an IF test. In cases where no condition testing is needed, the final END command in the procedure buffer will tell VISTA that the procedure has completed.

Examples:

  1. Here is an example of a conditional exit from a procedure. This procedure may be run with CALL or GO.
         LOOP:
            ASK 'Enter non-zero to process another image >> ' TEST
            IF TEST=0
               RETURN
            END_IF
             :
             :
         GOTO LOOP:
    
  2. END may be used as return ONLY if it is the last command in the file. Thus a procedure like:
         (commands)
         END
    
    may be executed as a subroutine, but one that looks like:
         IF TEST=0
            END
         END_IF
    
    will not work. Use RETURN instead.