Reference Guide > E Routines > ERASE Procedure
  

ERASE Procedure
Erases the display surface of the currently active window.
Usage
ERASE [, background_color]
Input Parameters
background_color—(optional) The background color index.
 
note
Not all devices support this parameter. Workstations and display terminals, such as X workstations and Tektronix terminals, generally do, while some hardcopy devices, such as HPGL plotters, do not.
Keywords
Channel—The destination channel index or mask for the operation. Use only with devices with multiple display channels. If Channel is omitted, the system variable !P.Channel is used.
Color—The background color index. If specified (and the parameter background_color is not specified), Color overrides the value of the system variable !P.Background.
Discussion
ERASE is a low-level graphics routine. It resets the display surface to the default background color (normally 0), which is indexed from the current color translation tables by the system variable !P.Background. You can override the default by specifying background_color.
ERASE affects the current window only; to switch windows, use the WINDOW command.
A side effect of ERASE is that the device is reset to alphanumeric mode if it has such a mode (e.g., Tektronix terminals).
Example 1
Erase display surface for the current window and use the value in !P.Background to set the background color.
ERASE
Example 2
; Load in color table 2, GRN-RED-BLU-WHT, for distinctive colors.
LOADCT, 2
; Display the color table.
COLOR_PALETTE
; Create window 1.
WINDOW, 1
; Erase it using !P.Background.
ERASE
; Create window 2.
WINDOW, 2
; Erase it, setting the background color to 27 (lime green).
ERASE, WoColorConvert(27)
; Switch back to window 1.
WINDOW, 1
; Reset the background color to 75 (bright red).
ERASE, WoColorConvert(75)
; Switch back to window 2.
WINDOW, 2
; Explicitly set the background color to 180 (lavender).
!P.Background = WoColorConvert(180)
; Set the background color based on !P.Background.
ERASE
See Also
!P.Background, WDELETE,   WINDOW

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.