Saves away an area of the screen (text and attributes) for subsequent restoration.
The area between the top-line and bottom-line inclusive is saved. Therefore, if top-line and bottom-line are equivalent, a single line of the screen is saved.
Note that specifying zero as a top-line or bottom-line means that parameter will be considered to be the last line on the screen. This saves you from having to know the size of the screen if, for instance, you wished to save the whole screen.
The logical value of top-line must be equal or less than the logical value of bottom-line.
To save the screen in its entirety, whatever its size:
call "CBL_SCR_SAVE" using by value 0 size 4 1 size 4 0 size 4 returning handle.
To save just the last line of the screen:
call "CBL_SCR_SAVE" using by value 0 size 4 0 size 4 0 size 4 returning handle.
To save the top three lines of the screen:
call "CBL_SCR_SAVE" using by value 0 size 4 1 size 4 3 size 4 returning handle.
Comments:
Because the three parameters are passed BY VALUE, any or all of them may be specified with numeric literals. For example, "BY VALUE 12 SIZE 4".
CBL_SCR_SAVE has advantages over reading areas of the screen directly:
If handle is not subsequently passed to the CBL_SCR_RESTORE routine, any core memory that may have been allocated to save the screen information in will be lost. Repeated failure to call CBL_SCR_RESTORE with handles returned will therefore result in a memory leak.
It is invalid to pass handle to any routine other than CBL_SCR_RESTORE.