A BASIC command used to call a subroutine. Unfortunately, most dialects could only handle line numbers and no other arguments, making GOSUB little better than its cousin GOTO for purposes of avoiding spaghetti code. Each subroutine called by&a GOSUB must be ended by RETURN.

10 GOSUB 100
20 PRINT "World!":END
100 PRINT "Hello ";:RETURN

Log in or registerto write something here or to contact authors.