出典:Wikipedia
出典:『Wikipedia』 (2011/07/13 22:24 UTC 版)
GOSUB is a command in many versions of the BASIC computer programming language. GOSUB statements branch to simple kinds of subroutines without (sometimes with) parameters or local variables, the RETURN command resuming program flow from the point at which GOSUB was invoked. The GOSUB command is convenient for performing the same function several times in a BASIC program without duplicating the code. Using GOSUB too many times, as in a loop, without corresponding RETURN statements would typically cause a stack overflow and when the BASIC interpreter encounters a RETURN statement without a GOSUB it will emit a RETURN WITHOUT GOSUB error.