[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ON...GOSUB               Branch to nth Item in Subroutine List

 ON n GOSUB {linenum | linelabel}, [,{linenum | linelabel}]...

    Causes Turbo Basic to branch to one of a list of subroutine starting
    lines.

           n    A numeric variable in the range 0 to 255. Upon execution
                of the ON...GOSUB statement, Turbo Basic branches to the
                nth item in the list of line numbers that follows the
                keyword GOSUB.

     linenum    The first line number of a subroutine.

   linelabel    A label identifying the first line of a subroutine.

   --------------------------------------------------------------------------

      Notes:    If n is 0 or larger than the number of items in the line
                list, Turbo Basic continues with the next executable
                statement.

                The SELECT and IF block statements are more flexible
                versions of multi-way branching.

See Also: IF ON...GOTO SELECT
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson