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

RWINDOW

Keyword Abbreviation Token (hex) Version(s) Classification
RWDINDOW R{Shift+W} CE 09 7.0 Function

  Syntax  
RWINDOW ( info )
 
Parameters Type Legal Value(s) Note(s)
info Unsigned Byte
  1. get window height -1
  2. get window width -1
  3. get screen width
 
Returns Type Value(s) Note(s)
value Integer
0 to 79
 
  Purpose  
Return information about the active text editor.
 
  Remarks  
RWDINDOW sounds like it should be the complement to WINDOW, but unfortunately none of the possible values that may retrieved correspond with any parameter of WINDOW.  To make maters worse, the returned window "height" and "width" are off by one... epic fail!
 
It seems most useful to determine which editor of the C128 is active (40-column VIC-II or 80-column VDC) with WINDOW(2).  If you would like to know the active parameters of WINDOW (left, top, right, or bottom) then you will need to take a PEEK at some secret variables.  Some CBM machines with pre-7.0 versions of BASIC support windows via the KERNAL/Editor (not directly with BASIC).  For them, peeking at secret variables is the only option.
 
The returned value will be (based on info):
  1. the active window's "height" = bottom - top (NOTE: this is the physical height -1)
  2. the active window's "width" = right - left (NOTE: this is the physical width -1)
  3. the active screen's width (thankfully, this is correct: 40 or 80)
If info is omitted, or is an invalid expression, SYNTAX ERROR occurs.  If info is not numeric, TYPE MISMATCH ERROR occurs; you may manually convert strings with VAL.  If info is floating-point, it is automatically converted with INT.  If the result is not a Legal Value (see table above), then ILLEGAL QUANTITY ERROR occurs.
 
Examples (in 80-column mode, full-screen [no window active]):
PRINT RWINDOW("0")

?TYPE MISMATCH ERROR 
READY.
PRINT RWINDOW(0)
 24
 
READY.
PRINT RWINDOW(1)
 79

READY.
PRINT RWINDOW(2)
 80

READY.
 
  Compare With  
 
  Contrast With  
 
  See Also  

© H2Obsession, 2014
Comments