Previous Topic Next topic Print topic


CBL_SCR_RESTORE

Restores an area of the character-mode screen previously saved with a call to the CBL_SCR_SAVE call-by-name routine.

Note: This routine is supported for native COBOL only.

Syntax:

call NoReturnCode "CBL_SCR_RESTORE" using by value     flags
                                                       handle

Parameters:

  Using call prototype (see Key) Picture
flags cblt-x4-comp5. pic x(4) comp-5.
handle cblt-pointer. usage pointer.

On Entry:

flags Currently, this must always be zero.
handle A "save-handle" previously returned by a call to the CBL_SCR_SAVE call-by-name routine. This handle can be NULL, in which case the call does nothing.

On Exit:

handle Is untouched, but invalid. It must not be passed again to CBL_SCR_RESTORE unless it has subsequently been re-assigned a valid "save-handle" by a further call to the CBL_SCR_SAVE routine. We recommend that you set this pointer to NULL immediately on return from CBL_SCR_RESTORE. The area of the screen saved when the call to CBL_SCR_SAVE which returned handle was made is written, in the same position, to the screen.

Comments:

Because the flags parameter is passed BY VALUE, it may be specified as a numeric literal. For example, "BY VALUE 0 SIZE 4".

This call returns no status value. Therefore, it must be called using a suitable call-convention (as suggested in the syntax description) that you have defined in the special-names section. A suitable convention for this purpose is 4.

CBL_SCR_RESTORE has advantages over writing areas of the screen directly:

  • There is no need to have wasteful buffer space allocated in the working-storage section of your program.
  • Using any single-byte attribute method to write the screen (for example CBL_READ_SCR_ATTRS) requires indirection through the Generic Attributes system and thus a best-match guess has to be made for attributes not in the current palette. On certain systems the result of writing the attributes back to the screen can yield very inaccurate results. This call attempts to minimize this effect by actually saving an internal representation of the screen contents and therefore removing the possibility of information loss.
  • This call is very fast.

It is valid to change the mode of the screen (for example, switch the screen to 132-column mode) after saving an area of the screen with CBL_SCR_SAVE providing that the mode is restored to the previous setting before calling CBL_SCR_RESTORE. Failure to do so will result in undefined results.

Previous Topic Next topic Print topic