Commodore‎ > ‎BASIC‎ > ‎Keywords‎ > ‎

STOP

Keyword Abbreviation Token (hex) Version(s) Classification
STOP S{Shift+T} 90 1.0 to 4.7 Command* and Statement
STOP ST{Shift+O} 90 7.0 Command* and Statement

 
Syntax  
STOP
 
 
Purpose  
Program flow control.  Stop executing the current program and enter direct mode.

 
 
Remarks  
This statement is intended for debugging.  When this statement is encountered, the computer will print BREAK and if a program is running it will also print IN line_number, where line_number is, naturally, whichever line BASIC is executing when STOP is executed.  If a program is running, BASIC will then transition into direct mode.
 
The same thing essentially happens when the user presses the STOP key while a program is running.  Pressing the STOP key in direct mode (no program running) generally has no effect (unless BASIC is busy doing something, like loading or listing a program).
 
Note that the although BASIC will print a BREAK IN lineNumber message (in most versions of BASIC), the reserved variables EL and ER are not updated by the STOP statement or the STOP key.
 
* STOP may be entered as a command in direct mode, but it has no effect because (by definition of direct mode) there is no program running. 
 
This statement updates a secret variable.  It is secret because BASIC provides no way to read the value (except for machine-specific PEEK).  It sets the secret value to "in direct mode" (0).
 
 
Compare With  
 
Contrast With  
 
See Also  

© H2Obsession, 2014
Comments