To activate the utility enter at the DCL prompt
$ DSI SCREENor define a symbol such as
$ SCREEN == "$DSILIB:SCREEN".The following page is displayed :
Screen Maintenance V3.5 File Name ____________________________________________________________ Page Name Field Name Prompt Vert Pos 0 Bold Hor Pos 0 Underscore Length 0 Reverse Vert Offset 0 Blink Hor Offset 0 Mask Default : F10=Exit
If the page/field does not exist the prompt "Add " will appear at the bottom of the screen. A RETURN will place the cursor at the prompt entry and a new field may be added. An N or any escape sequence will return the cursor to the field entry.
If the page/field already exists then the current value will be displayed and the cursor will move to the Change/Delete entry. A C or a RETURN will move the cursor to the prompt entry where any field may be updated. A D will prompt you with a 'Sure DELETE field '. If a Y is now entered the currently displayed field will be deleted. Any escape sequence or RETURN will return the cursor to the Field Name entry.
The DO key at any point updates any changes made. The EXIT key return the cursor to the field entry without updating the screen file.
At the page, field or Change/Delete entry a PF1 will switch to display mode and show the current page with all specified video attributes. If there is no current page, you will be asked the page to display.
At the page, field or Change/Delete entry a PF2 will ask for an output specification defaulting to SYS$OUTPUT. The contents of the screen file will be printed first in alpha sequence then in row, column sequence.
PF1 will return the screen to the field maintenance page with the values of the selected field from the display page filled in.
PF2 will prompt for an output file specification and then will output an image of the current page.
INSERT_HERE will insert a blank line above the currently selected field moving it and all fields below it down one line. Any fields that would be moved off the bottom of the screen will stop at the bottom.
REMOVE will delete a line from the screen by moving all lines from the currently selected field to the end of the screen up one line. If a field is already at the top of the screen, it will not be moved.
Neither the INSERT_HERE nor REMOVE line functions delete fields, they only add or delete lines on the screen. REMOVE may cause existing fields to overlap.
SELECT will allow a prompt or a field to be moved on the screen by using the arrow keys. SELECT operates in two modes: The first time SELECT is pressed, 'SELECT PROMPT' mode is activated and the prompt and field may be positioned with the arrow keys. The second time SELECT is pressed, 'SELECT FIELD' mode is activated and the FIELD alone may be positioned. Press SELECT again to return to the normal field to field mode for the arrow keys.
PF3 in the display mode changes the screen to graphics mode to access the VT100/VT200/VT300 series line drawing set. The cursor goes to the upper left corner and the message 'UP' is displayed in the upper right corner. In the graphic mode the arrow keys are used to move the cursor on the page. When the 'pen' is up no changes to the screen are made. When you want to draw lines, press D for down and the pen mode will change to down. The pen will now draw lines on the screen as it is moved. Pressing the E for erase changes the pen mode to erase and any line that the cursor goes over will be erased. The pen mode can be changed to up by pressing U for up. When the pen mode is down the numeric keypad is mapped to allow corners and intersections to be displayed. Each of the keys 1 thru 9 is a corner or intersection according to the following sequence:
Typing F for finish will exit the graphics mode and return to the normal display mode. All the graphics for a page is stored as a single structure so if multiple graphic images are to be stored, they must be on separate pages.
There is no check for fields that overlap each other and no support for 132 columns screens.
Screen files may be used in programs by inserting directives into the program that are read by the precompiler. Each directive begins with the character sequence $DSI. Remember that the precompiler makes a single pass and directives are executed in lexical order. Each field on the screen is composed of two areas. The first is the prompt area where the text for a field is displayed and the second is the data area where the data for the field is entered.
SCREEN FILE
To reference a screen file in a program the following directive must appear before any other screen directive:
$DSI SCREEN
This will cause the screen file to be opened. This directive can appear more than once but each use will close the previously referenced screen file. The screen file extension if not specified will default to .SCR.
SCREEN PAGE
Next the current screen page is selected with the following directive:
$DSI PAGE
This page name is used by the DISPLAY and PRINT directives with the field name to locate the field record in the screen file. until another page directive changes the current page.
FIELD DISPLAY
Each field is painted by the DISPLAY directive. The optional argument must be a string and will be displayed as the default field value.
$DSI DISPLAY [string]
If the screen has already been painted with the field text by the DISPLAY directives the PRINT directive can be used to update the data portion of the display.
$DSI PRINT
If the data to be displayed is not a string then a string function can be used to format the data. Most of the ENTER_* modules have a corresponding DSI_FORMAT function that will ensure a consistent display between fields that are entered through ENTER_* modules and PRINT or DISPLAY directives.
CLEARING THE SCREEN
The screen is cleared by using the directive:
$DSI CLEAR [Text]
If the text parameter is present it will be displayed in normal video. This is the standard way to exit a program to turn off the video attributes.
GRAPHICS
$DSI GRAPH
This will load the graphics stored on the page into the screen buffer. It does not actually display the graphics but they will appear after the next screen repaint. I/O OPTIMIZATION
The precompiler optimizes I/O based on the expected sequence of:
$DSI CLEAR
$DSI GRAPH page
$DSI DISPLAY field string
.
.
.
The precompiler will insert a call to DSI_REPAINT after the display directives automatically so the entire screen will paint in one output operation. The optimized sequence stops when anything other than a blank line, a DISPLAY or a PRINT directive. Therefore any formatting of strings should be performed before the CLEAR and any conditional fields should be placed after the DISPLAYS or PRINTS that are always executed.
Basic Precompiler Specifics
The data entry modules that position the cursor all start with the format:
CALL ENTER_(x position, y position, length, ...
In order to use the information from the screen file, replace the first three parameters with a percent sign and then the field name.
CALL ENTER_type(%field, ...
-- or --
CALL ENTER_type({field}, ...
-- or --
CALL XYPRINT({field}, ...
In the last two formats the {field} can be modified by appending a :ROW, :COL, and/or :LEN to the field name. For example:
CALL ENTER_STRING({COMPANY:ROW+J:LEN+3}, COMPANY, COMPANY)
The input will be taken J rows down from where the screen field COMPANY is defined and the data field will be extended 3 spaces. The same logic applies to XYPRINT.
Also the module TERM_POS which is normally referenced as
CALL TERM_POS(x, y)
can be written to use the x and y position of the prompt of a field as follows
a) CALL TERM_POS(%field)
b) CALL TERM_POS({field})
c) CALL TERM_POS({field} + value, value)
d) CALL TERM_POS(value, {field} + value)
e) CALL TERM_POS({field} + value, {field} + value)
All directives will be deleted and all field references will be replaced in the output file which is then passed on to the compiler. Examples c thru e will fill in only the appropriate vertical or horizontal position. This allows indexing from a screen designated screen position. EG:
CALL TERM_POS({TEXT} + J, 10) FOR J = 10 TO 15
Normally the precompiler is called by issuing the command:
$ DSI PREBASIC
The program extension may not be specified and is always taken as .BAS. If the program requires a command procedure to build it, use the following sequence to obtain a VAX Basic version of the source code:
$DSI DSICOM
$BASIC/TYPE:EXPLICIT .TMP
$LINK ,,...
Cobol Precompiler Specifics
The calls to the data entry modules are made through the following directive:
$DSI ENTER_
The data type parameter must be one of the types supported by the callable modules. The allowable data types are DATE, DOUBLE, INTEGER, LONG, MONEY, REAL, SINGLE, STRING, TIME and WORD.
The field name parameter, along with the page name in the last screen directive, specifies the field to use. This defines the row, column, length of the input field.
The result and default parameters must both be of the same variable type as the beginning data type parameter. Dates and times are string data type and money is a double floating data type. The value entered is returned in the variable specified by the result parameter. The value returned if the user just enters a carriage return is specified by the default parameter.
An example of a call to input a date field at the screen position defined by page MAIN, field INVDATE, returning a value into INVOICE-DATE and defaulting to DEF-DATE would be:
$DSI PAGE MAIN
$DSI ENTER_DATE({INVDATE}, INVOICE-DATE, DEF-DATE)
Note that the PAGE directive is only required once for all the fields on the same page.
The current screen can be saved by moving the data in DSI_SCREEN_BUFFER to a local variable. To restore the screen move the local variable back into DSI_SCREEN_BUFFER and call DSI_REPAINT.
In order to compile a program with screen directives the programmer enters DSICOB . This invokes the precompiler which reads the source program, interprets the directives and writes a new file name>.TMP. This is then passed through the Cobol compiler and linked against the callable module library.
If the program also calls other subprograms then a command procedure
can be constructed that runs the precompiler on each source segment. If
a program MAIN calls three subprograms SUB1, SUB2 and SUB3 then the
following command procedure will precompile, compile and link the
program:
$! MAIN.COM
$! Build program MAIN which calls SUB1, SUB2 and SUB3
$
$RUN DSILIB:PRECOBOL MAIN
$COBOL MAIN.TMP
$DEL MAIN.TMP;*
$
$RUN DSILIB:PRECOBOL SUB1
$COBOL SUB1.TMP
$DEL SUB1.TMP;*
$
$RUN DSILIB:PRECOBOL SUB2
$COBOL SUB2.TMP
$DEL SUB2.TMP;*
$
$RUN DSILIB:PRECOBOL SUB3
$COBOL SUB3.TMP
$DEL SUB3.TMP;*
$
$LINK MAIN,SUB1,SUB2,SUB3,-
DSILIB:DSILIB/LIBRARY,DSILIB:DSILIB/OPTION