◄Example► ◄Contents► ◄Index► ◄Back► ────────────────────────────────────────────────────────────────────────────── 'This example uses the GOSUB and RETURN statements to branch to and return 'from a subroutine with and without using linelabel statements. CLS GOSUB PrintMessage PRINT "This message is in module-level code" GOSUB Sub1 PRINT "This line in module-level code should be skipped." Label1: PRINT "This message is back in module-level code" END PrintMessage: PRINT "This program illustrates use of the GOSUB and RETURN statements." PRINT RETURN Sub1: PRINT "This message is in Sub1." GOSUB Sub2 PRINT "This line in Sub1 should be skipped." Label2: PRINT "This message is back in Sub1." RETURN Label1 Sub2: PRINT "This message is in Sub2." RETURN Label2 'Cannot return from here to main program - only to SUB1.