# GOTO Example

Syntax: GOTO

NOTE: This is written for the BS2 and will run on any BASIC Stamp module. Modify the $STAMP directive (as required) before downloading to the BS1, BS2e, BS2sx, BS2p, BS2pe, or BS2px.

    ' GOTO.BS2
    ' This program isn't practical at all, but demonstrates the use of GOTO to
    ' jump around the code.  This code jumps between three different routines,
    ' each of which print something different on the screen.  The routines are
    ' out of order for this example.

    ' {$STAMP BS2}

    Start:
      GOTO Routine1

    Routine2:
      DEBUG "We're in routine #2", CR
      PAUSE 1000
      GOTO Routine3

    Routine1:
      DEBUG "We're in routine #1", CR
      PAUSE 1000
      GOTO Routine2

    Routine3:
      DEBUG "We're in routine #3", CR
      PAUSE 1000
      GOTO Routine1

Go to Welcome page

BASIC Stamp Help Version 2.5.4

Copyright © Parallax Inc.

8/8/2012