RETURN
Syntax
- When returning from a GO SUB sentence
- When returning (exiting) from a SUB (a subroutine)
- When returning (exiting) from a FUNCTION. In this case a return value must be specified.
Returns in the global scope (that is, outside any function or sub) are treated as return from GO SUB. Otherwise, they are considered as returning from the function or sub they are into.
WARNING: Using RETURN in global scope without a GOSUB will mostly crash your program.
Use--stack-checkif you suspect you have this bug, to detect it.
Example with GO SUB
This will output:
Remarks
- This statement is Sinclair BASIC compatible.