[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3.4.5 Clear Screen, Cursor Stays (@R)

The Clear Screen, Cursor Stays command works in any video mode. It is exactly like the Clear Screen, Home Cursor command, except that the position of the cursor is not changed.

In text mode (Cogsys mode 0), the screen is cleared by writing spaces to all positions. In Mode 1, zero (black) is written to all pixels. In Mode 2, however, the screen is set to the color specified by the contents of the Cogsys variable COGVAR_CLEARCOLOR, which is variable number , by default. All Cogsys variables are set to zero initially; so the default Mode 2 behavior is to create a black screen.

Name:
Clear Screen, Cursor Stays
Class:
Display Text
Code:
@R
Syntax:
@R
System:
Clears the screen to black. If in Cogsys Mode 2, clears the screen to the color specified by the value of Cogsys variable COGVAR_CLEARCOLOR. The position of the cursor is not changed.
Requires:
Clear Screen, Cursor Stays will work in any video mode.
History:
Before Cogsys 3, @R only worked in text mode, and the now now-obsolete #H command was used to clear the video modes. Cursor positioning with #H was mode dependent--in 256-color modes (what is now called Mode 2, then Mode 101), the cursor was homed. In other modes, it was not.

Thus, references to the #H in 256 color modes should be replaced with @C. References to #H in other graphics modes should be replaced with @R.

Test Files:
`CSCS_T01.IN'
tests basic operation in all three video modes
`CSCS_B01.IN'
benchmarks the time to execute @R 1000 times in text mode

Examples:

input
press return to erase this text,
but#R@R continue writing at same position.
cogsys
Writes the first part of the sentence, then waits for a keypress, erases the whole screen, and continues writing the sentence just after `but' was displayed.

input
%M2$AV=10@R
cogsys
Switches to video mode 2, sets the Cogsys COGVAR_CLEARCOLOR variable to 10, which is the standard palette index (A. Standard Palette) to green. The @R clears the screen to green, and the cursor does not move.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Usman Muzaffar on June, 28 2000 using texi2html