End

Syntax:

    End

Command Availability:

Available on all microcontrollers.

Explanation:

When the End command is used, the program will immediately stop running. There are very few cases where this command is needed — generally, the program should be an endless loop.

Example:

    'This program will turn on the red light, but not the green light
    Set RED On
    End          ' <<< the End instruction
    Set GREEN On

Key line: End — halts the program immediately after RED is switched on, so the following Set GREEN On line is never reached.

See Also:

  • Do — the endless-loop pattern most GCBASIC programs use instead of ending
  • Exit — exiting the current routine without stopping the whole program