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

2.3.4.4 Clear Screen, Cursor Home (@C)

The Clear Screen, Cursor Home command works in any video mode. It clears the screen and moves the cursor to the top left (0,0) position.

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 Home
Class:
Display Text
Code:
@C
Syntax:
@C
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 cursor is moved to the top left of the screen.
Requires:
Clear Screen, Cursor Home will work in any video mode.

History:
Before Cogsys 3, @C 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:
`CSCH_T01.IN'
tests basic operation in all three video modes
`CSCH_B01.IN'
benchmarks the time to execute @C 1000 times in text mode

Examples:

input
Press return to home cursor: #R@CTop of screen!
cogsys
Writes the prompt, waits for a key press. Then it clears the screen, and writes `Top of screen!' at the top left corner of the screen.

input
%M2$AV=10@C
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 @C clears the screen to green, and homes the cursor.


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

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