Function RestScreen() Foundation

Redisplays screen contents previously saved with SaveScreen().

Syntax
RestScreen( [<nTop>]   , [<nLeft>] , ;
            [<nBottom>], [<nRight>], <cScreen>) --> NIL
Parameters
<nTop>
<nTop> is an integer numeric value which determines the top screen row of the area where the saved screen information is redisplayed. The four arguments <nTop>, <nLeft>, <nBottom> and <nRight> determine the coordinates within which the information contained in <cScreen> is displayed. If no coordinates are specified when saving the screen contents with SaveScreen(), no coordinates need to be specified when calling RestScreen().
<nLeft>
<nLeft> is an integer numeric value which determines the left screen column for the display area.
<nBottom>
<nBottom> is an integer numeric value which determines the bottom screen row for the display area.
<nRight>
<nRight> is an integer numeric value which determines the right screen column for the display area.
<cScreen>
<cScreen> is a character string which contains the characters from the screen along with their color attributes.
Return

RestScreen() always returns the value NIL.

Description

The screen function RestScreen() normally redisplays a segment of screen previously saved using the function SaveScreen(). The display can occur any place on the entire screen. When a saved screen segment is displayed at a new location, the new segment must have the same dimensions as the original.

Every second character in the character pairs comprising <cScreen>contains the color attribute for the visible character placed on the screen.

Examples
Draw a shadow around a box with RestScreen()

// The example shows how a shadow can be output around 
// a box using RestScreen(). 
// Further detailed examples of SaveScreen() and RestScreen() 
// are shown with the function SaveScreen(). 

PROCEDURE Main 
   LOCAL nTop:=7, nLeft:=10, nBottom:=17 , nRight:=60, cScreen 

   SetColor("N/BG")              // output background 
   DispBox(0,0,MaxRow(),MaxCol(),Replicate(Chr(176),9) ) 

                                 // output box 
   DispBox( nTop, nLeft, nBottom, nRight, 2, "W+/R" ) 

                                 // save right shadow area 
   cScreen := SaveScreen(nTop+1,nRight+1,nBottom+1,nRight+2) 
                                 // replace color attributes with 
   cScreen := Transform( cScreen,; // attribute for "N+/N" 
                 Replicate("X"+Chr(8), Len(cScreen)/2) ) 
                                 // output right shadow area 
   RestScreen(nTop+1,nRight+1,nBottom+1,nRight+2,cScreen ) 

                                 // save bottom shadow area 
   cScreen := SaveScreen(nBottom+1,nLeft+2,nBottom+1,nRight) 
                                 // replace color attributes with 
   cScreen := Transform( cScreen,; // attribute for "N+/N" 
                 Replicate("X"+Chr(8), Len(cScreen)/2) ) 
                                 // output bottom shadow area 
   RestScreen(nBottom+1,nLeft+2,nBottom+1,nRight,cScreen ) 

RETURN 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.