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

SCNCLR

Keyword Abbreviation Token (hex) Version(s) Classification
SCNCLR S{Shift+C} E8 3.5, 7.0 Command and Statement
INSTR IN{Shift+S} E8 4.7 Function

 
  Syntax   
SCNCLR mode ]
 
Parameters Type Legal Value(s) Default Value Note(s)
mode Unsigned Byte
  1. 40-column text
  2. *Hi-res bitmap
  3. *Hi-res bitmap & 40-column text
  4. *Multi-color bitmap
  5. *Multi-color bitmap & 40-column text
  6. **80-column text
RGR() * Bitmap must be allocated.
** V7.0 (C128) only
 
 
  Purpose  
Video initialization.  Clear one or more video screens.

 
  Remarks  
SCNCLR will clear one or more video screens.  SCNCLR is typically used for clearing a bitmap because it is often easier to use PRINT to clear only the text screen.  SCNCLR allows the same mode parameter as GRAPHIC, but the difference is that SCNCLR will not change the current video mode.  So you may for example, clear the bitmap while displaying a text screen (or vice-versa).  Also, a parameter is not required with SCNCLR.
 
If a supplied mode is an invalid expression, or if additional parameters are given, SYNTAX ERROR is generated.  If a supplied mode is not numeric, TYPE MISMATCH ERROR occurs; you may convert a string with VAL.  A floating-point mode will be converted automatically with INT.  If the result is not a Legal Value (see table above) then ILLEGAL QUANTITY ERROR occurs.  In particular, mode 5 is only legal for the C128 (v7.0).  If the result is legal and refers to a bitmap screen, but no bitmap has been allocated with GRAPHIC, then NO GRAPHICS AREA ERROR occurs.  By supplying mode you can clear one or two display screens at once (much like GRAPHIC with the clear option).
 
If mode is omitted, then RGR will be called to get the current video mode.  This can never generate an error.  On the C128 (v7.0), RGR may return a mode value greater than 5.  Although SCNCLR will not generate an error, you are not allowed to specify such numbers if you supply mode.  This is logically inconsistant.  Anyway, if the returned mode is greater than 5, the 80-column text screen will be cleared first, and then SCNCLR will procede as if you entered mode-5.  Because that may clear two screens (bitmap and 40-column text) and the 80-column screen has been cleared, it is possible to clear 3 screens with one command.  However, it is not possible to clear both 40 and 80 column text screens without also clearing a bitmap.  Note if RGR returns mode of 5 then only the 80-column text screen is cleared.
 
If the mode (supplied or calculated from RGR) refers to a split-screen mode, then the 40-column text cursor will be positioned at the top of the text portion of the split-screen, although the entire text screen (including the part hidden by the bitmap) is cleared.  If the mode is zero then the 40-column text cursor will be positioned at the top row.  If neither of these apply then the 40-column text cursor is not re-positioned.  If the mode is 5 or more, the 80-column text cursor will be positioned at the top row.  If the mode refers to a bitmap, then the pixel-cursor (see LOCATE) will be reset to 0,0.
 
Examples:
SCNCLR : REM clears the currently displayed screen(s)

READY.
SCNCLR 5 : REM clears 80-column text screen (not valid on all machines)

READY.
SCNCLR 0 : REM clears the 40-column text screen

READY.
SCNCLR 1 : REM clear the high-resolution bitmap

?NO GRAPHICS AREA ERROR
READY.
GRAPHIC 1: GRAPHIC 0: REM allocate bitmap, switch back to text mode

READY.
SCNCLR 1 : REM clear the high-resolution bitmap

READY.
 
 
  Compare With  
 
  Contrast With  
  See Also  

© H2Obsession, 2014
Comments