Please enable JavaScript to view this site.

A-Shell Consolidated Reference

Reviewed and revised December 2023

tab(-10, AG_SAVERES); cmd, id; chr(127);     Tab(-10,x) Syntax Notes

AG_SAVERES (40) provides a way to save and restore copies of the screen using an ID number rather than a stack like Tab(-1,202) and Tab(-1,203).

Parameters

cmd

Character code indicating the action to perform:

Value

Description

S

Save screen

R

Restore screen

P

Pop (discard) previously saved screen

id

A numeric digit, 0 thru 9. 0 on the restore or pop commands refers to the last saved screen (whatever id it has).

Response

none

Examples

? TAB(-10,AG_SAVERES);"S,1";chr(127);     ! save screen with ID 1

? TAB(-10,AG_SAVERES);"S,5";chr(127);     ! save screen with ID 5

? TAB(-10,AG_SAVERES);"R,1";chr(127);     ! restore screen saved as ID 1

? TAB(-10,AG_SAVERES);"R,0";chr(127);     ! same as TAB(-1,203) 

                                  ! (i.e. restore last saved screen)

? TAB(-10,AG_SAVERES);"P,3";chr(127);     ! pop/discard screen saved as ID 3

? TAB(-10,AG_SAVERES);"P,0";chr(127);     ! pop/discard last saved screen

Comments

This capability was implemented via a Tab(-10,x) sequence rather than by extending the existing Tab(-1,202) or Tab(-1,203) commands, because those commands do not have terminators and thus we cannot just add optional arguments. Because Tab(-10,x) commands must be terminated with chr(127), they support variable length arg lists.

AG_SAVERES sequences are only supported under A-Shell/Windows and under Unix when the client is ATE.

AG_SAVERES does save and restore GUI controls. However, it is advisable that you clear the screen with Tab(-1,0) before restoring a saved screen which contains GUI controls; otherwise the restore controls will be added to any controls already existing on the screen.

Unlike Tab(-1,202) and Tab(-1,203), which operate on the machine where the software is running, Tab(-10,x) sequences operate on the workstation. Thus, under Unix, the save/restore operation takes place entirely on the workstation. This reduces both network traffic, memory, and CPU usage on the server, but it should be noted that the server's copy of the screen map will not be updated. This could interfere with server-based screen pictures, and also with the operation of TCRTs 202/203 after AG_SAVERES, since those TCRTs interact with the server's screen map. (The problem is temporary though, since the server's screen map gets re-synchronized whenever you clear and repaint the screen with regular, server-based PRINT statements.)