VSPACE
Published By | Date | Version | Knowledge Level | Keywords |
---|---|---|---|---|
Revelation Technologies | 14 NOV 1989 | 2.X | EXPERT | VSPACE |
Description
VSPACE processes all virtual space operations. Multiple virtual screens may exist, limited only by the amount of memory available. Data may be written to a virtual screen, and for each screen, a window may be defined in order to view the data (see Appendix 4, Virtual Space). The virtual space operations are described in the operator parameter below.
Arguments
operator
Determines the type of operation a call to VSPACE is to perform. Note that the VBACK operation must precede those operations affecting the definition or placement of a window (see the appropriate op.parameters description).
The following are the definitions for the VSPACE operators (these are also defined in the VIRTUAL.PARAMS record of the UTILITY.PROGS file):
EQU VINIT TO 1 EQU VSIZE TO 2 EQU VBACK TO 3 EQU VPRNT TO 4 EQU VWMOV TO 5 EQU VWEXP TO 6 EQU VWPAN TO 7 EQU VCPOS TO 10 EQU VGETC TO 11 EQU VGETA TO 12 EQU VSAVE TO 13 EQU VRSTR TO 14 EQU VSCRL TO 15 EQU VWGET TO 16 EQU VWSET TO 17 EQU VPOFF TO 18 EQU VSOFF TO 19 EQU VON TO 5 ;* a constant EQU VOFFSET TO 26 ;* a constant
The following operations are available:
Operator | Operation |
---|---|
VINIT | Initializes a virtual screen and defines the coordinates |
VSIZE | Resizes a virtual screen |
VBACK | Saves the previous display screen image in a screen variable. The image saved is used as the referential display screen for window operations (all window operations will be written to this display image). VBACK must be called prior to those operations affecting the definition or placement of a window. |
VPRNT | Writes a string to the virtual screen, echoing to the display screen if the data coordinates are within an existing window. VPRNT supports all R/BASIC PRINT features. |
VPOFF | Writes a string to the virtual screen only. VPOFF supports all R/BASIC PRINT features. |
VWMOV | Moves and displays the window |
VWEXP | Resizes and displays the window |
VWPAN | Pans the window across the virtual screen |
VWSET | Sets (defines) the window parameters and displays the new window. The size of a window is limited to the dimensions of the display (CRT). |
VWGET | Returns the window parameters in the variables specified |
VSOFF | Sets (defines) the window parameters and does not display the new window. VSOFF differs from VWSET only in this respect. |
VCPOS | Returns the virtual screen current cursor position in the variables specified |
VGETC | Returns the character at the specified virtual screen coordinates in the designated variable |
VGETA | Returns the video attribute at the specified virtual screen coordinates in the designated variable |
VSAVE | Saves the specified portion of the virtual screen in the designated variable |
VRSTR | Restores the specified portion of the virtual screen |
VON | A constant (value of 5) passed by the system to the AREV.COMMON variable VIRTUAL to indicate that a window is a virtual space object |
VOFFSET | A constant (value of 26) which defines the number of bytes to the end of the header (descriptive block) of the virtual screen variable (see screen below). |
status
A variable used by VSPACE to return an integer value indicating the status of the operation performed:
Value | Status |
---|---|
0 | Successful operation |
1 | Invalid operator |
2 | Invalid display type |
3 | Insufficient string space |
4 | Invalid screen dimensions |
5 | Invalid screen |
6 | Insufficient parameters |
screen
A variable used by VSPACE to store the virtual screen image defined. Note that the exception to this is when used with the VBACK operator. In this case, screen refers to the previous display image and must be a different variable than that used to store the virtual screen image.
op.parameters
These parameters are dependent upon the operator specified. The parameters are to be treated as normal argument list parameters (delimited by commas). The following is a listing of the requirements for each operator, and a description of the values expected:
Operator | Parameters |
---|---|
VINIT | cols, rows Integers indicating the size of the virtual screen. The size of a virtual screen is limited by the amount of memory available. |
VSIZE | cols, rows Integers indicating the new dimensions of the virtual screen. The resizing occurs at the right side and bottom of the virtual screen. |
VBACK | col.size, row.size Integers indicating the size of the previous display image to save in the screen variable. VBACK must be called before any VSPACE window operations. |
VPRNT | col,row, string String is written beginning at the specified integer coordinates of the virtual screen. If the coordinates are within an existing window, string is also sent to the window. |
VPOFF | col,row, string String is written beginning at the specified integer coordinates of the virtual screen. |
VWMOV | cols, rows, display, border Cols and rows must be integers specifying the number of columns and rows to move the window, relative to its current position. VWMOV must be preceded by a call to VBACK, display being the screen value (previous display image) returned by VBACK. If true, border indicates that the window border is to be erased. |
VWEXP | cols, rows, display, border Cols and rows must be integers specifying the number of columns and rows by which to redimension the window. The redimensioning occurs at the right side and bottom of the screen. Negative column or row values indicate a contraction of the window size. VWEXP must be preceded by a call to VBACK, display being the screen value (previous display image) returned by VBACK. If true, border indicates that the window border is to be erased. |
VWPAN | vcol, vrow, display Specifies an increment or decrement of the window offsets into the virtual screen (positioning of the window within the virtual screen) by col and row integer amounts. VWPAN must be preceded by a call to VBACK, display being the screen value (previous display image) returned by VBACK. |
VWSET |
vrow are the column and row integer offsets into the virtual screen. The size of a window is limited to the size of the display (CRT). VWSET must be preceded by a call to VBACK, display being the screen value (previous display image) returned by VBACK.|
VWGET |
vrow are the column and row integer offsets into the virtual screen. VWGET must be preceded by a call to VBACK, display being the screen value (previous display image) returned by VBACK.|
VSOFF | top.left.col, top.left.row, bot.right.col, bot.right.row, vcol,vrow, display, border Integers indicating the top-left and bottom-right coordinates dimensioning the window. Vcol and vrow are the column and row integer offsets into the virtual screen. VWSET must be preceded by a call to VBACK, display being the screen value (previous display image) returned by VBACK. |
VCPOS | vcol ,vrow Specifies the variables in which the coordinates of the current virtual cursor position are to be returned. |
VGETC | vcol, vrow, char Vcol and vrow must be integers specifying the virtual screen coordinates at which to read a character value. The value is then returned in char. |
VGETA | vcol, vrow, attribute Vcol and vrow must be integers specifying the virtual screen coordinates at which to read a video attribute value. The value is then returned in attribute. |
VSAVE | top.left.vcol, top.left.vrow, bot.right.vcol, bot.right.vrow, screen Integers indicating the top-left and bottom-right coordinates of the virtual screen to save. The virtual screen image will be saved in the screen variable. |
VRSTR | top.left.vcol, top.left.vrow, bot.right.vcol, bot.right.vrow, screen Integers indicating the top-left and bottom-right coordinates of the virtual screen to restore. The virtual screen image will be restored from the data in the screen variable. |
Values returned
VSPACE may pass a value in an op.parameters variable of the argument list. This depends on the operator used.
Examples
*Initialization DECLARE SUBROUTINE VSPACE,MSG,BORDER.UP $INSERT UTILITY.PROGS,VIRTUAL.PARAMS *Create and store a virtual screen 160 x 160 for use in *subsequent operations COLS = 160 ROWS = 160 VSPACE(VINIT,STATUS,VSCREEN,COLS,ROWS) *Write a string to the virtual screen IF STATUS = 0 THEN COL = 1 ROW = 1 VSPACE(VPRNT,STATUS,VSCREEN,COL,ROW,"Press [Enter] to continue") END ELSE MSG('VSPACE error: %1%','','',STATUS) END *Return and display a character from the virtual screen IF STATUS = 0 THEN VSPACE(VGETC,STATUS,VSCREEN,3,1,CHAR) MSG('The character at the virtual screen coordinates is: %1%','','',CHAR) END ELSE MSG('VSPACE error: %1%','','',STATUS) END *Save and clear the current display image. The cleared screen *will serve as the referential display for subsequent *window operations IF STATUS = 0 THEN VIDEO.RW(0,0,@CRTWIDE-1,@CRTMAXHIGH-1,'R',IMAGE) VIDEO.RW(0,0,@CRTWIDE-1,@CRTMAXHIGH-1,'C','') VSPACE(VBACK,STATUS,DISPLAY,@CRTWIDE-1,@CRTMAXHIGH-1) END ELSE MSG('VSPACE error: %1%','','',STATUS) END *Set parameters for a window in the current virtual screen, and *display the window with a border (see the system subroutine *BORDER.UP) IF STATUS = 0 THEN LEFT.COL = 10 TOP = 6 RIGHT.COL = 35 BOTTOM = 8 VCOL = 1 VROW = 1 VSPACE(VWSET,STATUS,VSCREEN,LEFT.COL,TOP,RIGHT.COL, BOTTOM,VCOL,VROW,DISPLAY) BORDER.UP(LEFT.COL-1,TOP- 1,RIGHT.COL+1,BOTTOM+1,2,'') MSG('The window is defined and displayed.|Next the display is cleared and the window is moved.','','','') END ELSE MSG('VSPACE error: %1%','','',STATUS) END *Clear the screen and move the window up IF STATUS = 0 THEN VIDEO.RW(0,0,@CRTWIDE-1,@CRTMAXHIGH-1,'C','') MOV.COLS = 0 MOV.ROWS = -5 TOP += MOV.ROWS BOTTOM += MOV.ROWS VSPACE(VWMOV,STATUS,VSCREEN,MOV.COLS,MOV.ROWS,DISPLAY,1) BORDER.UP(LEFT.COL-1,TOP-1,RIGHT.COL+1,BOTTOM+1,2,'') MSG('Finally, the window is expanded.','','','') END ELSE MSG('VSPACE error: %1%','','',STATUS) END *Clear the screen and expand the previously defined window, *restoring the previous display image as the final operation IF STATUS = 0 THEN VIDEO.RW(0,0,@CRTWIDE-1,@CRTMAXHIGH-1,'C','') EXP.COLS = 10 EXP.ROWS = 10 RIGHT.COL += EXP.COLS BOTTOM += EXP.ROWS VSPACE(VWEXP,STATUS,VSCREEN,EXP.COLS,EXP.ROWS,DISPLAY,0) BORDER.UP(LEFT.COL-1,TOP-1,RIGHT.COL+1,BOTTOM+1,2,'') MSG('The window may be as large as the display.','','','') VIDEO.RW(0,0,@CRTWIDE-1,@CRTMAXHIGH-1,'W',IMAGE) END ELSE MSG('VSPACE error: %1%','','',STATUS) END