xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

@...CLEAR

Clears the contents of the screen.

Syntax

@ <nTop>, <nLeft> [ CLEAR [TO <nBottom>, <nRight>] ]

Arguments

@ <nTop>, <nLeft>
Numeric values indicating the screen coordinates for the upper left corner of the @...CLEAR command. If the CLEAR option is not used, only one row of the screen is cleared from the position <nRow>, <nCol> to the rightmost column.
CLEAR
When this option is used, a rectangular area on the screen is cleared, beginning at <nTop> and <nLeft> down to <nBottom> and <nRight>.
TO <nBottom>, <nRight>
Numeric values indicating the screen coordinates for the lower right corner of the @...CLEAR command. <nBottom> defaults to MaxRow() and <nRight> defults to MaxCol(). Both parameters require the CLEAR option be used.

Description

The @...CLEAR command is used to clear a rectangular area on the screen in text mode applications. This is accomplished by displaying white space characters in the specified region using the standard color value of SetColor().

After the screen is cleared, the cursor is positioned at the top, left corner of the cleared rectangle. The new cursor position is reflected by the Row() and Col() functions.

Info

See also:@...BOX, CLEAR SCREEN, DispBox(), Scroll(), SetColor(), SetPos()
Category: Output commands
Source:rtl\scroll.c, rtl\setpos.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates various possibilities of
// erasing the screen and parts thereof.

   PROCEDURE Main

      SetColor( "W+/B" )
      CLEAR SCREEN

      SetColor( "W+/R" )

      @ 2, 0                    // deletes the second row

      @ 20, 40 CLEAR            // erase area to bottom/right

      @  5, 30 CLEAR TO 15, 55  // use all four coordinates

   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe