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?

GOSUB

Description

The GOSUB statement causes execution of a local subroutine, after which execution will continue with the next line of code.

GOSUB label

Where label refer to an existing label within the current source code.


Note: 

The compiler does not check for the existence of a RETURN statement and if no RETURN statement is encountered the program will continue until the final statement and not return to the original GOSUB.

An example of use is as:

GOSUB Initialize ;* open files etc..
GOSUB Main ;* perform main program
GOSUB Finish ;* close files etc..
STOP
...
Initialize: * open files
OPEN......
.
RETURN
....
Main: * main execution loop
......
RETURN
Finish: * clean up after execution
......
RETURN


Go back to jBASE BASIC.

Was this article helpful?