xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

SaveScreen()

Saves a rectangular screen region for later display.

Syntax

SaveScreen( [<nTop>], [<nLeft>], [<nBottom>], [<nRight>] ) --> cScreen

Arguments

<nTop>
A numeric value indicating the screen coordinate for the top row of the rectangular screen region to save. The default value is 0.
<nLeft>
A numeric values indicating the screen coordinate for the left column of the rectangular screen region to save. The default value is 0.
<nBottom>
A numeric value indicating the screen coordinate for the bottom row of the rectangular screen region to save. The default value is MaxRow().
<nRight>
A numeric values indicating the screen coordinate for the right column of the rectangular screen region to save. The default value is MaxCol().

Return

The function returns a character string holding textual and color information of the saved screen rectangle.

Description

SaveScreen() is used to save the current display in a console window. The function combines textual and color information in the returned string. This string can later be displayed using the RestScreen() function.

Note:  textual information on screen is placed at odd positions in the return string, while color attributes for each character are stored at even positions in the SaveScreen() string.

Info

See also:RestScreen()
Category: Screen functions
Source:rtl\saverest.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example saves a screen region, changes the display of that
// region, and restores it to its original state.

   PROCEDURE Main
      LOCAL nTop:=0, nLeft:=0, nBottom:=10, nRight:=40, cScreen

      cScreen := SaveScreen( nTop, nLeft, nBottom, nRight )
      SET COLOR TO "W+/B"
      DispBox( nTop, nLeft, nBottom, nRight )

      WAIT "Press a key..."

      RestScreen( nTop, nLeft, nBottom, nRight, cScreen )

      WAIT "Screen is restored Press a key..."
   RETURN

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