Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?

RETURN

Description

The RETURN statement transfers program execution to the caller of a subroutine/function or to a specific label in the program. It takes the general form:

RETURN{TO label}

or

RETURN(expression)

Where:

label must reference an existing label within the source of the program.

expression evaluates to the value that is returned by a user-written function.

Note:

  • The RETURN statement will transfer program execution to the statement after the GOSUB that called the current internal subroutine.
  • If the RETURN statement is executed in an external SUBROUTINE and there are no outstanding GOSUBs, then the program will transfer execution back to the program that called it via CALL.
  • The program will enter the debugger with an appropriate message should a RETURN be executed with no GOSUB or CALL outstanding.

The second form of the RETURN statement is used to return a value from a user-written function. This form can only be used in a user-written function. 


Go back to jBASE BASIC.

Was this article helpful?