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

CONT

Keyword Abbreviation Token (hex) Version(s) Classification
CONT C{Shift+O} 9A 1.0 to 3.5 Command and Statement*
CONT none 9A 4.0 to 7.0 Command and Statement*

 
Syntax  
CONT
 
 
Purpose  
Program flow control.  Resume executing a STOP'd program.

 
 
Remarks  
This command is intended for debugging.  When a program has been halted with the STOP (or END) statement or the STOP key, this command will generally switch the BASIC interpreter into RUN Mode and resume program execution at the next statement.  If there is no next statement (because the physical end of the program has been reached) the BASIC interpreter will then immediately switch back to direct mode and print READY (i.e., no error).
 
Once a program is stopped, the user is generally free to do anything desired in direct mode before (s)he continues the program.  However, the user should not add, DELETE, RENUMBER, or edit any program lines.  CLR should not be used.  Hopefully it is obvious the user should not load another BASIC program or NEW the current program either!  The user should also not enter commands that generate an error.  Violation of these "rules" will cause CONT to generate a CAN'T CONTINUE ERROR.  Note, however, that BASIC 4.0+ (and some BASIC extensions) permit the user to load a non-BASIC-program file with BLOAD (or similar) without causing a "violation of the rules."
 
Likewise, if the program stopped because of an error, or no program was previously executing, the CONT command will generate CAN'T CONTINUE ERROR.
 
* CONT may be entered as a statement within a program, but the effect varies on different machines.  On the C64, for example, the computer seems to get stuck on line zero (even if the program has no line zero).  On the C128, the statement is simply ignored.
 
In any case, the user may choose to resume the program by using GOTO (basically required if you CAN'T CONTINUE), but GOTO always starts execution on the first statement in a line, so the exact position that would (theoretically) be executed with CONT may not be reachable.  Using GOTO to resume at a relatively far distance from where the program stopped may later cause errors due to skipped LOOP/NEXT/RETURN statements.
 
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 RUN mode" (128).
 
Compare With  
 
Contrast With  
 
See Also  

© H2Obsession, 2014
Comments