logo
Powered by QM on a Rpi server
Home
About OpenQM
  What is OpenQM?
  What is Multivalue?
  Licensing Overview
  News
  Testimonials
  Case Studies
  Presentations
Sales and Downloads
Help and Support
About
Login

KnowledgeBase 00066: Save/Restore Screen Data

Last updated: 22 Jul 2016
Applies to: All versions
Search  
Top level index       Full Index Search Tips
Previous article     Next article

This article was originally published as a Tip of the Week.

When using a QMConsole session on Windows or the AccuTerm terminal emulator on all platforms, QM provides a way to save a rectangular area of the screen image that can subsequently be restored. This makes it very easy to construct menus or pop-up boxes without destroying previously displayed data.


Saving Screen Data

The function to save a rectangular area of the screen image is

   var = SAVE.SCREEN(col, line, width, height) 
where col and line identify the top left corner of the region to be saved and width and height specify the size of the region.

Note that when using AccuTerm, the data is not sent over the network but is stored internally by AccuTerm. The QMBasic variable holds a reference to this data, not the actual data. This results in best performance when saving large areas of text.


Restoring Data

The statement to restore previously stored data is

   RESTORE.SCREEN var, restore.state
where restore.state is a Boolean value that determines whether the cursor position, pagination mode and current display attributes are to be restored from the saved data.


Discarding Data

Saved screen data can be restored any number of times. The saved screen region will persist until the associated variable is overwritten or discarded (e.g. on program termination). The data saved within the terminal emulator will be automatically discarded at this time.


AccuTerm Terminal Types

Use of this capability requires that the terminfo sreg and rreg items are correctly defined. These are present in the terminal definitions with the -at suffix (e.g. vt100-at).


Related Articles

None.



Please tell us if this article was helpful
Very     Slightly     Not at all
Comments
Email (optional)