Skip to content

STOP

Syntax

STOP

Purpose

To terminate program execution and return to the BASIC prompt.

Remarks

STOP statements may be used anywhere in a program to terminate execution. When a STOP is encountered, the following message is printed: "Break in line nnnnn".

Unlike the END statement, the STOP statement does not close files. BASIC-80 always returns to the BASIC prompt after a STOP is executed. Execution is resumed by issuing a CONT command.

Example

10 INPUT A,B,C
20 K = A^2 * 5.3: L = B^3 / .26
30 STOP
40 M = C * K + 100: PRINT M

Output:

RUN
? 1,2,3
Break in 30
Ok
PRINT L
 30.7692
Ok
CONT
 115.9
Ok

This example shows how STOP interrupts execution, allows inspection of variables, and resumes with CONT.

See Also

  • CONT - Continue program execution after STOP
  • END - Terminate program execution and close all files, returning to the BASIC prompt
  • CHAIN - Call another program and pass variables
  • CLEAR - Reset variables and optionally set memory limits
  • RUN - Execute the current program
  • SYSTEM - Exit MBASIC and return to the operating system