Saving and Restoring Screens with MacWise

(version 12 or later)

Many host computers are programmed to instruct the client app to save and restore screens.

MacWise 12.0 or later supports three sets of escape sequences commonly used by PC clients

(HostAccess, Accuterm and System Builder).

The client app is responsible for storing the screens (MacWise, in this case). This was originally done back in the days of slow serial connections because it was much faster for the client to display stored screens instead of the host resending them to the client app.

But that legacy code remains on host computers and therefore needs to be supported.

MacWise version 12.0 supports up to 13 screen levels (also called slots, stacks or blocks).

Accuterm Escape Sequences:

Areas of the screen, called blocks, can be saved and restored. Any area of the screen can be defined as a block.

Each block can be captured from anywhere on the screen and then restored to any position on the screen.

Each block is defined by the ID which can be an alphanumeric string.

MacWise ignores the page attribute.

ESC CHAR(2)  jD ,ID CR Clear the screen block stored as ID

ESC CHAR(2) jS ,ID , col , row , width , height , page CR Save the screen block with ID

Saves a copy of the specified screen block (text, colors and 

visual effects) and terminal state in memory and associates the 

block with the specified identifier (ID) whichcan be an 

arbitrary alpha-numeric string (may not contain commas). Any 

number of screen blocks can be saved, but MacWise currently 

only supports 13 blocks. Coland rowspecify 

the upper-left corner of the block. If either is omitted or null, 

zero is assumed. Widthand heightspecify the size of the 

block. If widthor heightis omitted or null, the screen width 

or height is used. Pageoptionally specifies the terminal page 

for the block, and if omitted or null, the current page is used.

MacWise ignores the Page attribute.

ESC CHAR(2)  jR ,ID , col , row , page , state CR Restore the screen block with ID

Restores the screen block associated with the specified 

identifier (ID) to the screen. Coland rowspecify the upper- 

left corner of the destination. If either is omitted or null, the 

original position of the saved block isassumed. Page 

optionally specifies the terminal page for the destination, and 

if omitted or null, the current page is used. If stateis 1, the 

terminal state (current attribute, cursor position, write protect 

mode, etc.) is restored along with the screen contents.

MacWise always assumes the State is 1 and Page is ignored.

HostAccess Escape Sequences:

ESC [=Np Save the screen to slot N (where N is the slot number to save)

ESC [=Nq  Restore the screen from slot N (where N is the slot number to restore)

The following HostAccess escape sequences use a stack (or slot) method.

Each time ESC [=p is sent to the client from the host, the client saves the current screen to the current stack and then increments the stack by one. Then when  ESC [=q is sent to the client, the current stack is restored back to the current screen.

ESC [=p Save the current screen to the top of the stack

ESC [=q Restore the screen from the top of the stack back to the current screen.

System Builder Escape Sequences:

ESC [>xxp  where xx is the save level. Saves the current screen as level xx

ESC [>xxq  where xx is the restore level. Restores the screen from level xx

NOTE: You must have System Builder enabled under the Emulate Menu in MacWise

to process System Builder escape sequences.


NOTE: If you are doing some host programming, please be aware that you can only use one of the above methods for saving and restoring screens. For instance, you can't use HostAccess and Accuterm codes at the same time.

NOTE: HostAccess, Accuterm and System Builder are trademarks of their respective companies and are not associated with Carnation Software.