Purpose : Indicates the end of the execution of a subroutine.

Format: RETURN

Notes:  The  RETURN  statement is used to end the execution a subroutine called by the  GOSUB  statement.  Program execution is resumed at following line after the calling  GOSUB  statement.


# Subroutine Return Example.
# Execute a GOSUB...RETURN 10 times

loop_count = 0


print " This line is executed prior to the GoSub"

gosub my_sub

print " This line is executed after each Call. "

loop = loop + 1
if loop_count < 10
goto top_of_loop

# This is the listing of the subroutine

print " All I do is print the loop #: " loop

See Also:  GOSUB