#  >> K-12 >> AP Classes

How to Enter a Subroutine in QBasic

QBasic is a derivative of the former programming language Quick Basic. This programming language is often taught as a first language to new computer programmers. Entering subroutines in QBasic is slightly different than other modern programming languages because QBasic is procedurally programmed rather than an object-oriented programming language. This makes entering subroutines, the precursors to functions, slightly different in practice. The most common method of skipping through to a subroutine is the GOTO command.

Instructions

    • 1

      Add a line prior to the subroutine's code to act as a name and place a colon directly after the name. For example, "mySubroutine:."

    • 2

      Enter a "GOTO" command where the code should jump to the subroutine.

    • 3

      Follow the "GOTO" command with the name of the subroutine to be executed. This should not include the colon from before. For example, "GOTO mySubroutine" without the quotes is the proper text.

Learnify Hub © www.0685.com All Rights Reserved