Enabling and Disabling the Status Line in an R/BASIC Program
Published By | Date | Version | Knowledge Level | Keywords |
---|---|---|---|---|
Revelation Technologies | 30 JUL 1990 | 2.X | INTERMEDIATE | ENABLING, DISABLING, STATUSLINE, SCREEN |
While running an R/BASIC program, you may want to access all areas of the screen, including the area occupied by the status line. If the status line is on, you will need to turn it off temporarily. This can be accomplished by following these steps:
- Set the screen height to the desired level.
- Store the current screen image.
- Turn the status line off.
- Clear the screen.
- Do your processing.
- Turn the status line back on.
- Restore the screen image.
- Restore the screen height.
Figure 1 provides an example of these steps.
In other cases you may wish to temporarily prevent the status line from being updated during part of your program. For example, you may not want the user to see all of the system information that displays on the status line when your program does a PERFORM "SELECT…." The system variable @STATUS.ON can be changed to prevent the updates to the status line. Figure 2 shows this technique.
Examples
Figure 1
DECLARE FUNCTION ESC.TO.ATTR DECLARE SUBROUTINE VIDEO.RW * Change the screen height. @CRTHIGH += 3 * Save the screen image. VIDEO.RW(0, 0, @CRTWIDE - 1, @CRTMAXHIGH - 1,'R', IMAGE) * Turn off updates to the status line. SAVE_STATUS = @STATUS.ON @STATUS.ON = 0 * Clear the screen. @AW<3> contains the background color * for all windows. ATTR = ESC.TO.ATTR(@AW<3>) BACKCHAR = @ENVIRON.SET<2> ;* The backdrop character. VIDEO.RW(0, 0, @CRTWIDE - 1, @CRTMAXHIGH - 1,'C', BACKCHAR:ATTR) * * Processing goes here. * * Restore updates to the status line. @STATUS.ON = SAVE_STATUS * Restore the screen image. VIDEO.RW(0, 0, @CRTWIDE - 1, @CRTMAXHIGH - 1, 'W', IMAGE) * Restore the screen height. @CRTHIGH -= 3 * END OF PROGRAM STOP
Figure 2
@STATUS.ON = 0 PERFORM 'SELECT SAMPLE_CUSTOMER BY STATE (S' @STATUS.ON = 1