bas7advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
STOP Statement Details
  ◄Syntax►  ◄Details►  ◄Example►                 ◄Contents►  ◄Index►  ◄Back►
──────────────────────────────────────────────────────────────────────────────
STOP terminates the program.
 
STOP [n%]
    ■ The value n% can be used by DOS or OS/2 batch files or by
      non-BASIC programs. Untrapped errors and fatal errors set the value
      of n% to -1.
 
Usage Notes
    ■ You can place STOP statements anywhere in a program to terminate
      execution.
    ■ In a stand-alone program, STOP closes all files and returns to the
      operating system; in the QBX environment, STOP leaves files open
      and returns to the environment.
    ■ If you use the /D, /E, or /X compile option on the BC command line,
      the STOP statement prints line numbers as follows:
 
      If your program has        STOP prints
      ═══════════════════════    ══════════════════════════════════════════
      Line numbers               Number of the line where execution stopped
      No line number for STOP    Most recent line number
      No line numbers            0
 
    ■ In the QBX environment, STOP always returns an error level of 0 even
      if you specify a different error level.
    ■ In some previous versions of BASIC, STOP statements were used for
      debugging. In the current version of BASIC, you do not have to use
      STOP for debugging.