

Task

Clear the screen, output something on the display, and then restore the screen to the preserved state that it was in before the task was carried out.

There is no requirement to change the font or kerning in this task, however character decorations and attributes are expected to be preserved.   If the implementer decides to change the font or kerning during the display of the temporary screen, then these settings need to be restored prior to exit.




'' 640x480x8, with 3 pages
Screen 12,,3
Windowtitle "Terminal control/Preserve screen"
 
'' text for working page #2 (visible page #0)
Screenset 2, 0
Cls
Print "This is the new screen, following a CLS"
 
'' text for working page #1 (visible page #0)
Screenset 1, 0
Cls
Print "This is the original screen"
 
' page #0 is the working page (visible page #0)
Screenset 0, 0
 
Screencopy 1, 0
Sleep 1000 '1 second
Screencopy 2, 0
Sleep 1000
Print
For i As Byte = 5 To 1 Step -1
    Print "Going back in: "; i
    Sleep 1000
Next i
Screencopy 1, 0
Sleep