qb45advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
RETURN Statement Details
  QuickSCREEN      Details      Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
RETURN Statement Details
 
Syntax
  RETURN [{linelabel | linenumber}]
 
Without a line label, RETURN continues execution where an event occurred
(for event handling), or at the statement following the GOSUB (for subroutine
calls). GOSUB and RETURN without a line label can be used anywhere in a
program, but the GOSUB and corresponding RETURN must be at the same level.
 
The linelabel or linenumber in the RETURN statement causes an unconditional
return from a GOSUB subroutine to the specified line. RETURN with a line
label or line number can only return control to a statement in the
module-level code.
 
A RETURN statement cannot be used to return control to a calling program
from a subprogram defined by SUB. Use EXIT SUB.
 
  Note: BASIC's SUB procedures provide a better structured alternative
        to GOSUB subroutines.