GOSUB     CALL
 
Syntax


GOSUB label

    or

CALL label

version 7.00-

[CALL]  function/sub

Description


Execution jumps to a subroutine marked by line label. Always use RETURN to exit a GOSUB, execution will continue on next statement after Gosub.

label may be defined as label: or as a SUB or FUNCTION

CALL added in version 6.25d

And in version 7.00 the CALL for a FUNCTION or SUB is optional.  When CALLing a FUNCTION the return value is discarded.

Example

GOSUB message
END

message:
PRINT "Welcome!
return
 
Differences from other BASICs

See also