Mouse Support for Character Interfaces | Using Screens |
Screens is a screen painter designed to enable you to rapidly specify screen layouts and generate COBOL code for screen handling. Powerful functionality is provided by Screens to support easy specification of screen layouts and their subsequent modification.
The Screens facility enables you to:
Notes:
This section describes how to invoke Screens, the use of the cursor movement keys when designing screens and the menus and functions available in Screens.
To invoke Screens, enter the command line:
component [filename]
where the parameters are:
component |
The program-name for the system component to be
invoked, in this case Screens:
|
||||||
filename |
The name of the file to initially load. |
Windows and OS/2:
Alternatively, on Windows and OS/2, if you have created a group for
COBOL, you double-click on the appropriate program icon to invoke the
component.
You can also invoke Screens from the COBOL Editor by selecting Ctrl+F6=draw/forms from the COBOL Editor main menu, followed by F7=screens.
Note: Screens enables you to load files created with Forms and Forms-2 utilities. Files created with Forms-2 must have the file extensions .s00 and .s01 for text and data respectively. You cannot load files with other extensions, such as .s03 or .s04.
The initial screen that appears displays an information line and the
main menu, which occupies two lines. The rest of the screen displays a
stored screen form if filename
is specified,
otherwise it is blank. Other options are accessed from the Alternate and
Control menus. Each menu and its options are described in later sections.
The information line and main menu are shown in Figure 9-1:
Figure 9-1: Screens Information Line and Main Menu
The information line initially displays:
New form
As you work with Screens, the information line is updated with the following information:
Information |
Description |
---|---|
form-name | The name given to the form when it was loaded or saved appears at the beginning of the information line. If the form is new, then "New form" is displayed. If the name is more than eight characters, it is truncated. |
attribute | The attribute currently associated with the next character to be typed is displayed as part of this word. If attributes are suppressed, the word Attribute disappears. |
field/group-name | If the cursor is currently positioned on a field, the word field appears on the information line. The name of the field is displayed if one has been given. If no name has been given, then the name in the USING, TO, or FROM clause is displayed. If the cursor is currently positioned inside a group, then the field display is replaced with the group display. |
group order | This applies only to groups and displays H or V depending on whether the group is accepted first horizontally or vertically. |
row and column | The position of the cursor is continually displayed. |
The help function (F1=help) is available from each menu within the Screens utility. Press F1=help to display the help screen for additional information about the options available on the current menu.
In addition to the options available on each menu, the following keys have particular functions while you are using the Screens utility. Some of these keys behave differently when used with specific options within Screens. The table below shows the general use of these keys. Additional uses of these keys are described in the discussion of the specific option.
Some of them are notional key-names which may not be present on your keyboard. For IBM keyboards, the appropriate key combinations are shown in parentheses at the end of the notional key description.
Key |
Function |
---|---|
<left-arrow> | Moves the cursor left one character position. |
<right-arrow> | Moves the cursor right one character position. |
<up-arrow> | Moves the cursor up one line unless Scroll Lock is on, which instead causes the text to move down one line. |
<down-arrow> | Moves the cursor down one line unless Scroll Lock is on, which instead causes the text to move up one line. |
Tab | Moves the cursor to the next tab position to the right. |
Backtab | Moves the cursor to the next tab position to the left. |
Backspace | Deletes the character to the left of the cursor position, and moves the cursor left one character position. |
Enter | Moves the cursor to the first character position on the next line. |
Home | Moves the cursor to column one of the same line. |
End | Moves the cursor to the position after the last character on the current line, or to column 80 if there are no characters after the current cursor position. |
Del | Deletes the character at the cursor position. |
Ctrl+End | Toggles menus on and off. |
The Screens menus are organized to provide rapid access to the most commonly used functions. You can access help menus from any Screens menu by pressing F1=help. This calls the help screen for the option from which it was called.
The hierarchy of the three menus central to Screens' operation is shown in Figures 9-2, 9-3 and 9-4.
The menus described in this section appear in alphabetical order, apart from the Index Program menus which are covered in the section Index Programs later in this chapter.
Figure 9-2: The Screens Main Menu
Figure 9-3: The Alternate Menu
The Alternate menu is displayed by holding down Alt from the Screens main menu. This menu is shown in Figure 9-5.
Figure 9-5: The Alternate Menu
The Alternate menu displays functions that enable you to perform the following actions:
Pressing Alt+F9=attribute-palette from the Screens main menu displays the Attribute Selection menu. This menu is displayed in Figure 9-6.
Figure 9-6: The Attribute Selection Menu
The Attribute Selection menu displays functions that enable you to select the default attribute and the five attributes that are available to you from the Screens main menu. These are known as the roll attributes.
Pressing F7=cut-to-block or F8=copy-to-block from the main menu when you have marked a block displays the Block menu. This menu is shown in Figure 9-7.
The Block menu displays functions that enable you to perform the following actions:
Holding down the Ctrl key from the Screens main menu displays the Control menu. This menu is shown in Figure 9-8.
The Control Menu displays functions that enable you to perform the following actions:
Pressing F6=draw from the Control menu displays the Draw menu. This menu is shown in Figure 9-9.
The Draw menu displays functions that enable you to draw single or double lines to enhance the appearance of your screens.
Selecting a valid field and pressing F3=field from the Screens main menu displays the Field menu as shown in Figure 9-10, and its associated popup menu.
The Field menu displays functions that enable you to specify a clause to be associated with the selected field. See the section Screen Section Clauses later in this chapter for more information on the clauses shown in Figure 9-10 and its associated popup menu.
Pressing Alt+F5=generate-COBOL from the Screens main menu
displays the initial Generate-COBOL menu. This menu is displayed in
Figure 9-11.
Figure 9-11: The Initial Generate-COBOL Menu
After typing a filename and pressing ENTER, the Generate-COBOL menu is displayed as shown in Figure 9-12.
Figure 9-12: The Generate-COBOL Menu
The Generate-COBOL menu displays functions that enable you to perform the following actions:
Selecting a valid group and pressing F4=group from the Screens main menu displays the Group menu. This menu is shown in Figure 9-13.
The Group menu displays functions that enable you to perform the following actions:
Pressing F2=assign-properties from the Group menu displays the Group Properties menu, as shown in Figure 9-14, and an associated popup menu.
Figure 9-14: The Group Properties Menu
The Group Properties menu displays functions that enable you to specify a clause to be associated with the selected group. See the section Screen Section Clauses later in this chapter for more information on the clauses you can specify from this menu and its associated popup men.
Pressing Alt+F3=load from the Screens main menu displays the Load form menu. This menu is shown in Figure 9-15.
The Load form menu enables you to load a previously saved screen, with the option of using the Directory facility to show all screens available for loading.
Pressing F7=mark-fields from the Generate-COBOL menu displays the Mark Fields menu. This menu is shown in Figure 9-16.
Figure 9-16: The Mark Fields Menu
The Mark Fields menu displays functions that enable you to perform the following actions:
Pressing Alt+F4=save from the Screens main menu displays the Save menu. This menu is shown in Figure 9-17.
The Save menu enables you to save a screen, with the option of using the Directory facility to show all screens previously saved.
The Screens main menu is displayed when you invoke Screens (see the section Invoking Screens earlier in this chapter). This menu is shown in Figure 9-18.
Figure 9-18: The Screens Main Menu
The Screens main menu provides access both to other menus and direct functions. The Screens main menu displays functions that enable you to perform the following actions:
Screens functions are accessed from menus. The function-names are sometimes abbreviated on the menus.
The following section contains a quick reference listing of all the functions available in Screens. This listing is followed by detailed descriptions of these functions.
The following list shows the available functions in alphabetical order and indicates the keys you must press to access them. Thus, to determine the path to access a given function, follow the sequence of keystrokes. For example, to reach the Mark Prime Key function, you press the Alt+F5=generate-COBOL key, followed by the F7=mark-fields key, followed by F2=mark-field-key.
Function |
Menu Access Keys |
---|---|
Assign Properties | F4, F2 |
Attribute Roll | F6 |
Attribute Selection | Alt+F9 |
Attributes | Alt+F2 |
Clear Screen | Alt+F6 |
Copy from Block | F7, F3 or F8, F3 |
Copy to Block | F8 |
Cut to Block | F7 |
Define Field | F3 |
Define Group | F4 |
Delete Field Definition | Ctrl+F9 |
Delete Group Definition | Ctrl+F10 |
Delete Group Horizontally | F4, F5 |
Delete Group Vertically | F4, F6 |
Delete Line | Alt+F7 |
Draw | Ctrl+F6 |
Edit Field Clause | F3, F3 |
Edit Group Clause | F4, F2, F3 |
Escape | Escape |
Generate-COBOL | Alt+F5 |
Generate Data Descriptions | Alt+F5, F2 |
Generate Index Program | Alt+F5, F5 |
Generate Skeleton Program | Alt+F5, F3 |
Highlight Left Special Character | Ctrl+F3 |
Highlight Right Special Character | Ctrl+F4 |
Insert Line | Alt+F8 |
Load File | Alt+F3 |
Mark Block | F2 |
Mark Fields | Alt+F5, F7 |
Mark First Alternative Key | Alt+F5, F7, F3 |
Mark Prime Key | Alt+F5, F7, F2 |
Mark Second Alternative Key | Alt+F5, F7, F4 |
Mark Third Alternative Key | Alt+F5, F7, F5 |
Paint Attribute | F5 |
Paste Block | F7, F2 or F8, F2 |
Read Attribute | Ctrl+F8 |
Read Character | Ctrl+F7 |
Repeat Group Horizontally | F4, F3 |
Repeat Group Vertically | F4, F4 |
Restore Block | F9 |
Save File | Alt+F4 |
Screen Name | Alt+F10 |
Screen to Editor | Ctrl+F2 |
Select Attributes | |
Select Field Clause | F3, F2 |
Select Group Clause | F4, F2, F2 |
Select Special Character | Ctrl+F5 |
Set Character Attribute | Ctrl+F6, F4 |
Set Clear Screen Mode | Alt+F5, F6 |
Set Default Attribute | Alt+F9, F7 |
Set Drawing Mode | Ctrl+F6, F2 |
Set Field Order | F10 |
Set Field Type | F3, F4 |
Set IDX Mode | Alt+F5, F8 |
Set Line Mode | Ctrl+F6, F3 |
Set Monitor Type | Alt+F5, F4 |
Set Roll Attribute Five | Alt+F9, F6 |
Set Roll Attribute Four | Alt+F9, F5 |
Set Roll Attribute One | Alt+F9, F2 |
Set Roll Attribute Three | Alt+F9, F4 |
Set Roll Attribute Two | Alt+F9, F3 |
Show Previously Saved Screens | Alt+F3, F2 or Alt+F4, F2 |
Store Block | F7, F4 or F8, F4 |
Unmark Key | Alt+F5, F7, F6 |
This section describes the functions available with Screens. Functions for use with the Index program are described later in this chapter.
Displays the Assign Properties menu which is described in the section Menus. For a description of the functions available on this menu see Select Group Clause, Unselect Group Clause and Edit Group Clause.
Displays the Attribute Selection menu which is described in the section Menus. For a description of the functions available on this menu see the sections Set Roll Attribute One, Set Roll Attribute Two, Set Roll Attribute Three, Set Roll Attribute Four, Set Roll Attribute Five and Set Default Attribute.
Toggles the use of attributes on and off. When attributes are on, the word Attribute is displayed on the information line in the current attribute (specified by the Set Default Attribute function) and any text entered is painted in the current attribute.
When attributes are off, the word Attribute is not displayed on the information line, and any text entered is painted in the default attribute.
If you are displaying text in a Double-Byte Character Set (DBCS), when you paint attributes on the first byte of a double-byte character, the character might appear corrupt until you paint the second byte.
Clears the current form from the screen. If the current form has changed since it was last saved, the following prompt appears:
Clear without saving ? Y/N
Pressing Y or y clears the screen, abandoning any changes made since the form was last saved. Pressing N or n leaves the current form unchanged, abandoning the request to clear.
The marked block is copied to the screen in its current position. The block remains highlighted and you stay in the Block menu. You cannot copy a block over an area containing a field or group definition. See the section Mark Block for information on marking a block.
Places the marked block in a temporary buffer. The block remains visible on the screen in the position from which it has been copied. The Block menu is then displayed. Subsequent cursor movements move the block around the screen leaving the original block unchanged. See the section Mark Block for information on marking a block.
Places the marked block in a temporary buffer. The block remains visible on the screen in the position from which it has been cut. The Block menu is then displayed. See the section Mark Block for information on marking a block.
Enables you to define a field. You can do this in two ways:
Once a field has been selected, the caret characters are replaced by a COBOL picture string, and the Field menu is displayed (described in the section Menus earlier in this chapter). See the sections Select Field Clause, Edit Field Clause and Set Field Type for information on the functions available on the Field menu.
Minimal validation is performed on the field name, and only simple validation is performed on picture strings. The caret characters depict fields only when defined as fields; they can still be used as text characters.
Note : The maximum number of data entries a screen can contain is 200. This can be any combination of fields or groups. If you attempt to use more than 200 entries on a screen the following message appears:
Field table full
and the results on the existing fields are undefined. Using groups avoids the need for so many entries, and also makes the generated code smaller and easier to maintain.
Displays the Group menu (described in the section Menus earlier in this chapter) provided that the cursor is positioned in a previously defined group, or an area is marked using the Mark Block function. The marked area must contain at least one data field.
See the sections Assign Properties, Repeat Group Horizontally, Repeat Group Vertically, Delete Group Horizontally and Delete Group Vertically for information on the functions available from the Group menu.
Note: The maximum number of data entries a screen can contain is 200. This can be any combination of fields or groups. If you attempt to use more than 200 entries on a screen the following message appears:
Field table full
and the results on the existing fields are undefined. Using groups avoids the need for so many entries, and also makes the generated code smaller and easier to maintain.
Removes all references to the field containing the cursor as a field.
Removes the group definition and all group occurrences from the original marked item that was used to define that group. If the size of the fields inside a group requires editing, the group must first be deleted, then edited, and then redefined as a group.
Deletes a group occurrence to the left until there is one occurrence left.
Deletes a group occurrence upwards until there is one occurrence left.
Deletes the line on which the cursor is positioned and moves the lines below this line up by one. You cannot delete a line containing fields, nor can you delete a line in the middle of a group. To delete a line containing fields, you must first delete the fields using the Delete Field Definition function. See the section Delete Field Definition for more information on this function.
Displays the Draw Menu (described in the section Menus earlier in this chapter) to enable you to use line drawing to aid the presentation of diagrams and charts. See the sections Set Drawing Mode, Set Line Mode and Set Background Attribute for more information on the functions available on the Draw menu.
Enables you to change the additional information related to a previously specified clause. This option only applies to the Field name, PROMPT, SIZE, TO, FROM and USING clauses. See the section Select Field Clause for information on setting a clause for a field.
Enables you to change the additional information related to a previously specified clause. This option only applies to the Group-name and PROMPT clauses. See the section Select Group Clause for more information on setting a clause for a group.
Returns to the higher level menu or exits from Screens altogether if you are on the Screens main menu.
Displays the Generate-COBOL menu which is described in the section Menus. For a description of the functions available on this menu see the sections Generate Data Descriptions, Generate Skeleton Program, Set Monitor Type, Generate Index Program, Set Clear Screen Mode, Mark Fields and Set IDX Mode.
Enter the name of the output file to be created, or use the F2=directory option. If you pressed Alt+F5=generate-COBOL and the current form has changed since it was last saved, the following message appears:
Generate without saving? Y/N
Having entered a valid output name, the Generate-COBOL menu is displayed. This menu is shown in Figure 9-12.
Screens generates code in two ways:
If Screens is invoked from within the COBOL Editor, generated code is automatically modified and transferred back into the COBOL Editor for you to work with. The general rule in this situation is that all copyfiles are still written to the disk but the master source file is transferred to the COBOL Editor.
Generates the Screen Section code for the form. You can then include this file in your program. The file has the extension .ss.
Generates an entire COBOL program based on the form that you designed. The generated COBOL enables you to key data into the screen form. The data is then stored as records in an indexed sequential file . It is important that you only use the top 21 lines of the screen for your screen form. The index program requires the last four screen lines for its menus. No warning is given if you break this rule.
See the section Index Programs for information on how to use the index program with the code generated by this option.
Generates a skeleton program to display your form and accept any input. This file has the extension .cbl. The program references two copyfiles; one has the extension .ss and contains the Screen Section definitions for your form, the other has the extension .wks and contains the Working-Storage Section entries. When finished, the code produced by this function can be checked and run.
Enables you to specify one of the special characters displayed on the message line. These are the special characters. Pressing Ctrl+F3=char-left moves the highlighting one character to the left. If Scroll Lock is on, the highlighting remains stationary while the line of characters moves one character to the right. When the highlighting is over the special character you want to include in your form you should use the Select Special Character function. The currently highlighted special character, along with decimal and hexadecimal representations of its ASCII value, is shown next to the Ctrl+F5=select-char option on the menu.
Enables you to specify one of the special characters displayed on the message line. These are the special characters. Pressing Ctrl+F4=char-right moves the highlighting one character to the right. If Scroll Lock is on, the highlighting remains stationary while the line of special characters moves one character to the left. When the highlighting is over the special character you want to include in your form, you should use the Select Special Character function. The currently highlighted special character, along with decimal and hexadecimal representations of its ASCII value, is shown next to the Ctrl+F5=select-char option on the menu.
Inserts a line at the current cursor position. The lines below the cursor are moved down one line. If a line is inserted and the bottom line of the screen contains text, the bottom line is lost because a form can be no longer than 25 lines. If the bottom line contains any fields, the line is not inserted; you must first delete the field definitions. You cannot insert a line in the middle of a group.
Enables you to load previously saved screens, as well as forms produced by Forms and Forms-2 utilities.
You can load a file at program initialization by specifying a filename when invoking Screens. See the section Invoking Screens for more information.
Files created with Forms-2 must have the file extensions .s00 and .s01 for text and data, respectively. You cannot load files with the extensions such as .s02 and .s03.
Enables you to create a block for use with other functions from the Screens main menu such as Define Field, Define Group, Paint Attribute, Cut to Block and Copy to Block. Applying one of these functions to a block you have marked results in the function being applied to the marked area.
The marked area is shown in a reverse video attribute. Moving the cursor using the <left-arrow>, <right-arrow>, <up-arrow> <down-arrow>, Tab, Backtab, Home and End keys extends or contracts the marked area in a rectangular fashion from the original marked position.
The Mark Block function is a toggle; pressing F2=mark/unmark once starts to mark an area, pressing F2=mark/unmark again cancels the mark operation.
If you are displaying text in a Double-Byte Character Set (DBCS), when you mark a block over the first byte of a double-byte character, the character might appear corrupt until you mark the second byte.
Displays the Mark Fields menu which is described in the section Menus. For a description of the functions available on this menu see the sections Mark Prime Key, Mark First Alternative Key, Mark Second Alternative Key, Mark Third Alternative Key and Unmark Key.
Marks the field containing the cursor as the first alternate key. The field is highlighted with the number 1.
Index keys must be assigned in numerical order; that is, prime,
alternate 1, alternate 2, alternate 3.
Marks the field containing the cursor as the prime key. The selected field is highlighted with the letter P.
Index keys must be assigned in numerical order; that is, prime,
alternate 1, alternate 2, alternate 3.
Marks the field containing the cursor as the second alternate key. The field is highlighted with the number 2.
Index keys must be assigned in numerical order; that is, prime,
alternate 1, alternate 2, alternate 3.
Marks the field containing the cursor as the third alternate key. The field is highlighted with the number 3.
Index keys must be assigned in numerical order; that is, prime,
alternate 1, alternate 2, alternate 3.
Assigns the current attribute to the current cursor position. If the cursor is currently positioned on a field or group, then the entire field and its occurrences (if they are in a group) are painted with the selected attribute. If the Mark Block function is currently active, the entire marked area is painted. You can change the current attributes available by using the Attribute Selection function.
If you are displaying text in a Double-Byte Character Set (DBCS), when you paint attributes on the first byte of a double-byte character, the character might appear corrupt until you paint the second byte.
The marked block is pasted to the screen in its current position. You are returned to the Screens main menu. You cannot paste a block in an area defined as a field or one having a group definition. See the section Mark Block for information on marking a block for use with this function.
Selects the attribute at the current cursor position as the current attribute. If the word Attribute is displayed on the information line, it changes to show the new current attribute. The attribute read using this option replaces the previous attribute as a roll attribute.
Selects the character at the current cursor position as the current special character. Subsequent use of the Select Special Character function results in the display of this special character.
Repeats the marked group to the right, as long as there is sufficient space and no other data fields would be overwritten. If the group contains input fields, the direction of the initial repeat specifies the manner in which data is accepted into the group. If the first repeat is horizontal, fields in the group are accepted row by row, from left to right.
To change the acceptance manner for a group from horizontal to vertical, you must delete repeating occurrences (using the Delete Group Horizontally function) then expand the group again. The information line displays an H to indicate that the acceptance manner of the group is horizontal.
The information line displays H to indicate the acceptance manner of the group.
Repeats the marked group downwards, as long as there is sufficient space and no other data fields would be overwritten. If the group contains input fields, the direction of the initial repeat specifies the manner in which data is accepted into the group. If the first repeat is vertical, fields in the group are accepted column by column, from left to right.
To change the acceptance manner for a group from vertical to horizontal, you must delete repeating occurrences (using the Delete Group Vertically function) then expanded the group again.
The information line displays V to indicate that the acceptance manner of the group is vertical.
Retrieves the contents of a stored block from a stack of stored blocks. Blocks are stored using the Store Block function. See the section Store Block for information on storing blocks.
This function restores the last stored block and displays it in the temporary buffer which is visible on the screen.
Displays the Save menu (described in the section Menu earlier in this chapter), enabling you to save screens.
Enables you to assign a name to your screen. If you do not specify a screen name, a name prefixed by "G- " is assigned by the system.
Transfers an ASCII image of your form back into the COBOL Editor, leaving Screens and transferring you to the COBOL Editor. If the current form has changed since it was last saved, the following prompt appears:
Exit without saving? Y/N
Pressing Y or y transfers the form to the COBOL Editor, abandoning any changes made since the form was last saved. Pressing N or n leaves the current form unchanged, abandoning the request to transfer the form to the COBOL Editor.
This function only works if you invoked Screens from the COBOL Editor. To invoke Screens from the COBOL Editor, select Ctrl+F6=draw/forms from the COBOL Editor main menu, followed by F7=screens.
Cycles through the five roll attributes. The word Attribute on the information line is shown in the currently selected attribute.
See the sections Set Roll Attribute One, Set Roll Attribute Two, Set Roll Attribute Three, Set Roll Attribute Four, Set Roll Attribute Five for information on setting the roll attributes.
Selects or deselects the currently highlighted clause in the popup menu. > and < are used to highlight the current clause. Move up and down the clauses using<up-arrow> and <down-arrow>. The following clauses appear in the popup:
Field name
AUTO
FULL
PROMPT
REQUIRED
NO ECHO
ZERO FILL
BLANK WHEN ZERO
JUSTIFIED RIGHT
SIZE
BELL
TO
FROM
USING
See the section Screen Section Clauses later in this chapter for descriptions of the effects of setting the above clauses.
Selecting Field name, PROMPT, SIZE, TO, FROM or USING results in the display of a further prompt for the additional information. Failure to enter text for these clauses results in the generation of data identifiers for the missing entries at generation time. If literals are required for assignment, you must include them at the prompt.
Using this function on a clause that is already selected deselects that clause.
Selects or deselects the currently highlighted clause in the popup menu. > and < are used to highlight the current clause. Move up and down the clauses using<up-arrow> and <down-arrow>. The following clauses appear in the popup:
Group-name
AUTO
FULL
PROMPT
REQUIRED
NO ECHO
ZERO FILL
See the section Screen Section Clauses later in this chapter for descriptions of the effects of setting the above clauses.
Selecting Group-name or PROMPT results in the display of a further prompt for the additional information.
Using this function on a clause that is already selected deselects that clause.
Displays the special character you have selected using Highlight Left Special Character and Highlight Right Special Character functions. The character appears in the current attribute setting. The highlighted character is shown next to this menu option, with its decimal and hexadecimal ASCII values.
Changes the character attribute by cycling through the five roll attributes. Erasing a line drawing character actually replaces the character with a space in the default attribute. If you have changed the current attribute between drawing a line and erasing it, the space is drawn in the current attribute, not the attribute used when the character was drawn.
Selects whether or not to generate code to clear the screen before the screen is painted. The selected state is highlighted. The initial state for this is off.
This toggle is not used by the code generated by the Generate Index Program and Generate Skeleton Program functions, only having an effect on the Generate Data Descriptions function.
Installs the attribute at the current cursor position on the message line as the default attribute. All characters on your form that use the previous default attribute change to use the new default attribute. This function is useful for changing the attributes of a whole form.
Specifies the mode of operation, one of Draw, Erase or Move. The active mode is highlighted, and also displayed on the information line. In Draw mode, moving the cursor (using <left-arrow>, <right-arrow>, <up-arrow> and <down-arrow>) causes a line to be drawn. In Erase mode, moving the cursor causes any line at the cursor position to be replaced with a space in the current attribute. Move mode enables you to move the cursor around the screen without affecting the display. The initial setting is draw mode, as shown in Figure 9-9 in the section Draw Menu earlier in this chapter.
Enables data to be accepted in a sequence different other the standard order; that is, top-to-bottom, left-to-right. If the field order is not specified, the default specifies that the fields on the first line are accepted first in a left-to-right order, followed by the fields on the second line in a left-to-right order, down to the fields on the bottom line in a left-to-right order.
The priority of a field is denoted by its accept order character. You can assign an accept order character to a field, denoting the field's priority when being accepted. Valid field order characters are 0-9, A-Z and a-z, where field order 0 has the highest priority, and z the lowest. So, fields with field accept order character 0 are accepted first, followed by all fields with accept order character 1, down to fields with accept order character z. Fields with equal acceptance order characters are accepted from top left to bottom right in a left-to-right manner.
When you press F10=field-order, the fields on the screen are replaced with the number 5 (or their previously assigned accept order characters). To change the accept order of a field, move the cursor to a field and enter a valid accept order character. The field is replaced with the new character and the field's accept order is changed.
When a group is displayed, only the original fields (containing the accept order characters) of the group definition are displayed. When the code is generated for the new field orders, the group is accepted in its entirety. It is not possible to accept part of a group. If a group is two dimensional, then the horizontal or vertical order is determined by the order in which the group was first repeated.
Press F10=field-order again to return to normal data entry mode.
You can alter field sizes by positioning the cursor in the field and pressing the Del key (to reduce the size) or by turning on insert mode (Ins) and typing caret characters (to increase the size).
Specifies whether the field is numeric or alphanumeric. The default is alphanumeric. Pressing F4=numeric/alphanumeric toggles between the two states. A numeric field is denoted by 9s, whereas an alphanumeric field is denoted by Xs.
Enables those users with add-on products to select between two versions of the generated index program. The IDX version relies purely on the Screen Section in COBOL to perform its task (including displaying help), whereas the advanced-IDX makes use of features of add-on products. Using advanced-IDX, the index program has better help screen displays, and an additional function F2=directory to help you load index files.
The selected state is highlighted. If you are not using an add-on product the initial state for this toggle is IDX; whereas if you are using an add-on product the initial state is advanced-IDX.
Selects whether to draw single or double lines. Pressing F3=single/double toggles between single and double, the current selection being highlighted. The initial setting is single.
Selects whether the code generated for the painted form is more suitable for a color or monochrome display. The current state of this option is shown highlighted. The initial setting is for color.
This toggle is ignored by the code generated by both the Generate Skeleton Program and Generate Index Program functions, only having an effect on the Generate Data Descriptions function.
Installs the attribute at the current cursor position on the message line as the fifth of the five roll attributes. Use the Attribute Selection function to display the available attributes on the information line.
Installs the attribute at the current cursor position on the message line as the fourth of the five roll attributes. Use the Attribute Selection function to display the available attributes on the information line.
Installs the attribute at the current cursor position on the message line as the first of the five roll attributes. Use the Attribute Selection function to display the available attributes on the information line.
Installs the attribute at the current cursor position on the message line as the third of the five roll attributes. Use the Attribute Selection function to display the available attributes on the information line.
Installs the attribute at the current cursor position on the message line as the second of the five roll attributes. Use the Attribute Selection function to display the available attributes on the information line.
Uses the Directory facility to display all the forms that have been previously saved.
The marked block is erased, and placed into a first in, last out stack. You can use the Restore Block function to restore the blocks saved in this way. You can store up to 16 blocks.
Removes the index key mark (prime or alternate) from the field containing the cursor.
This section lists the Screen Section entries found on the popup menus on both the Field and Group Properties menu screens. They are listed in alphabetical order. For further information on how to use these clauses, see your Language Reference. For more information on the Field and Group Properties menus, see the sections The Field Menu and The Group Properties Menu.
Selecting the AUTO option causes the AUTO clause to be included in the Screen Section of your program. This clause causes an ACCEPT operation on the screen item to be terminated automatically when a character is keyed at the last character position, if there are no further fields on the screen; otherwise it skips automatically to the next field.
Selecting the BELL option causes the BELL clause to be included in the Screen Section of your program. This clause causes the alarm to sound each time the field is displayed.
The BLANK WHEN ZERO option causes the BLANK WHEN ZERO clause to be included in the Screen Section of your program. This clause causes a field to be blanked out if it contains only zeros.
The FROM option causes the FROM phrase to be included in the Screen Section of your program. This phrase results in the initial value of the field on the screen being taken from the identifier or literal specified with the FROM phrase.
The FULL option causes the FULL clause to be included in the Screen Section of your program. This clause results in an ACCEPT of that field requiring the field to be full or empty.
The JUSTIFIED RIGHT option causes the JUSTIFIED RIGHT clause to be included in the Screen Section of your program. This clause results in data entry during an ACCEPT operation being right-justified in the field.
The NO ECHO option causes the NO-ECHO clause to be included in the Screen Section of your program. This clause results in any ACCEPT of that field not displaying the entered characters. This is often used for password entry.
The PROMPT option causes the PROMPT clause to be included in the Screen Section of your program. This clause fills the field prior to an ACCEPT operation. When you select this option, you are prompted to enter a name. This name can either be a literal within quotes or a data name.
The REQUIRED option causes the REQUIRED clause to be included in the Screen Section of your program. This clause results in an ACCEPT of this item requiring that the field not be empty.
The SIZE option causes the SIZE clause to be included in the Screen Section of your program. This clause overrides the size specified by the number of carets in the field position. If the size is different from the number of carets in that field position than when the COBOL code is generated, the smaller size is used for accepting that field. If an identifier is specified with the SIZE clause, the size of the field can be dynamically altered at run time by the COBOL program.
The TO option causes the TO phrase to be included in the Screen Section of your program. This clause results in the accepted field being placed into the field defined after the TO entry.
The USING option causes the USING phrase to be included in the Screen Section of your program. This phrase causes the entry to be used as both a sending and a receiving area. Note that USING and TO are mutually exclusive, as are USING and FROM. However, TO and FROM can be used together or independently.
The ZERO FILL option causes the ZERO-FILL clause to be included in the Screen Section of your program. This clause results in the replacement of trailing prompt characters by zeros instead of spaces. This clause is valid only with numeric fields.
The following skeleton program was generated from the sample form created in the chapter Using Screens. It was then syntax-checked using the Compiler.
The variables in the code, in addition to the system drive and pathname, are due to the exact location of the fields on the screen and the attributes set for the fields, and as such could be different to any names you generated.
001 identification division. 002 data division. 003 working-storage section. 004 copy "myform.wks". 005 01 order-name pic x(12). 006 01 filler 007 03 occurs 5. 008 05 order-addr pic x(18). 009 01 order-tel-no pic x(7). 010 screen section. 011 copy "myform.ss". 012 01 g-myform. 013 02 blank screen. 014 02 line 1 col 6 background-color 0 foreground-color 7 015 highlight pic x(12) using order-name auto. 016 02 line 5 col 9. 017 02 g-001. 018 03 occurs 5. 019 04 pic x(18) using order-tel-no auto. 020 04 line + 1 col - 17. 021 02 line 1 col 51 pic x(7) using order-tel-no auto. 022 02 line 1 col 1 foreground color 1 highlight 023 value "Name:". 024 02 col 44 value "Tel No:". 025 02 line 5 col 1 value "ADDRESS:".. 026 02 line 13 col 28 highlight value "WARNING". 027 02 line 14 col 28 highlight value "MESSAGE". 028 procedure division. 029 display g-myform 030 accept g-myform. 031 stop run.
Screens also lets you generate an entire COBOL program based on a form that you design. The program that is generated allows you to key data into the form. The data is then stored as records in an indexed sequential file.
An indexed sequential file is a data file for which an alphabetic index is automatically maintained. The index is based on a key that you specify on your form. This key consists of one or more fields that you specified when you created the data area of your form. For example, if you design a form to hold information about names and telephone numbers, you may want to mark the NAME field as the key. This enables you to access records in alphabetical order by name. In addition to storing data, the index program lets you recall any record from disk, change or delete records, and conduct an alphabetical search through the file regardless of the order in which the records were entered.
The index program created using Screens lets you key data into a form. This data is then stored as records in an indexed sequential file. You can change, delete and add records to this file.
The order in which records are positioned in the index depends on the collating sequence of this COBOL system. For most business applications, the significant characters in the sequence are alphabetic characters. However, all 256 characters can be used in a file; this is why the collating sequence is important.
The design and implementation of the options available when running an Index program are patterned after the COBOL Indexed Sequential Access Method (ISAM). The options used to open files and the commands available for accessing records are those used in the COBOL language.
To generate an index program you must perform the following steps:
If you have forgotten to select an index key, the following message is displayed:
Incorrect index sequence
If this message is displayed you must use the F7=mark-fields option from the Generate-COBOL menu to correctly define the keys.
If you have not assigned a name to any of the index key fields, the following message is displayed:
Index field not named
If this message is displayed you must use the F3=field option from the Screens main menu to specify a data-name for the TO, FROM or USING clause.
When Screens is generating the index program, the code being generated scrolls up in the menu area.
What happens when Screens finishes generating the index program depends on whether you are using an add-on product:
You now compile, link and run the Index Program, as described in the chapter Developing COBOL Applications in your Object COBOL User Guide.
When you run the index program, the form design is displayed on the screen. The Index Program menu shown in Figure 9-19 is displayed, with the filename MYPROG displayed as an example.
Figure 9-19: The Index Program Menu
When you press Enter to run the index program using the file at the File prompt, the Automatic Mode menu is displayed. This menu is described in the following sections.
You can use several keyboard keys to move through the form as you enter data. These same keys are used in the COBOL Editor; however, they function in a slightly different manner when used with the Index program. All of them are available in both Manual and Automatic mode.
Key or Mouse Movement |
Effect |
---|---|
<left-arrow> | Moves the cursor one character position to the left. |
<right-arrow> | Moves the cursor one character position to the right. |
Home | Moves the cursor to the beginning of the first field on the screen. |
Ctrl+Home | Clears the contents of all fields from the screen. |
Tab | Moves the cursor to the beginning of the next field. |
Backtab | Moves the cursor to the beginning of the current or previous field. |
This section shows the menus you might encounter when running the index program.
The Automatic Mode menu is displayed when you have selected Automatic mode using the Set Program Mode function. This menu is displayed in Figure 9-20.
Figure 9-20: The Automatic Mode Menu
The Automatic Mode menu displays options which enable you to perform the following actions:
You can perform other actions in Automatic mode but they are not selected from a menu. See the section Index Program Functions for descriptions of functions you can use.
The Manual Mode menu is displayed when you have selected Manual mode using the Set Program Mode function. This menu is displayed in Figure 9-21.
Figure 9-21: The Manual Mode Menu
The Manual Mode menu displays options which enable you to perform the following actions:
This section describes the functions that are available from the Manual Mode and Automatic Mode menus. Where a function is only available in one of the modes this is highlighted.
The functions are listed in alphabetical order.
Pressing F9=delete deletes the record whose key is the same as the displayed key value. The current record pointer is left unchanged.
When the operation is complete, the word Successful appears on the message line. If the operation is not successful, the appropriate message appears instead.
Automatic:
The Delete function is not available in Automatic mode.
Reads the record whose key is the same as the displayed key value. If such a record does not exist the current record pointer is undefined.
Automatic:
In Automatic mode you access the Read-key function by pressing Enter
when you have entered the key field of the record to be read.
Manual:
In Manual mode you access the Read-key function by pressing F5=read-key
when you have entered the key field of the record to be read.
Reads the record at the current record pointer. If this record has already been read, the next record is read, and the current record pointer is updated.
Automatic:
In Automatic mode, pressing Enter when no changes have been
made to the key and data fields accesses the Read-next function.
Manual:
Pressing F6=read-next accesses the Read-next function.
Pressing F8=rewrite replaces the record whose key is the same as the displayed key value. The current record pointer is left unchanged.
The Rewrite function is useful for changing existing data.
Automatic:
The Rewrite function is not available in Automatic mode.
Pressing Shift+F10 selects an alternate index key. If no alternate indexes were marked when the index program was generated, this option is not available. A submenu is displayed enabling you to use F2, F3, F4 and F5 to view and change the alternate keys.
Automatic:
The Select Alternate Key Index function is not available in Automatic
mode.
Pressing F10=manual/auto toggles between the two modes of operation: manual and automatic. The default is automatic.
Pressing F2=start= sets the current record pointer to that of the displayed key value. If this value does not exist in the file, the current record pointer is undefined.
Automatic:
The Start= function is not available in Automatic mode.
Pressing F3=start>= sets the current record pointer to that of the displayed key value. If a record with a key equal to the displayed key value does not exist, the current record pointer is set to the record whose key is closest to, but not less than, the displayed key value.
Automatic:
The Start>= function is not available in Automatic mode.
Pressing F4=start> sets the current record pointer to the record whose key is closest to, but not less than, the displayed key field.
Automatic:
The Start> function is not available in Automatic mode.
The current cursor position is the first character position in the first key field on the screen. To begin entering data into the fields, type the data into the first field on the screen. When you reach the end of one field, the cursor automatically moves to the beginning of the next field if there is one. When you reach the end of the last field on the screen, the system beeps.
Continue entering data until you have entered data in all of the desired fields on the screen. Then press F7=write to store the screen display as a record. The message at the bottom of the screen indicates whether the write was successful.
After writing the record, the cursor automatically moves back to the first field on the screen. You can then begin entry of another record.
Automatic:
Access the Write function in Automatic mode by pressing Enter
when you have entered the data for the new record.
Manual:
Access the Write function in Manual mode by pressing F7=write
when you have entered the data for the new record.
The following is an alphabetical list of error messages that you might encounter when using Screens.
You have tried to store a block when the stack for storing blocks is full. The maximum number of blocks that can be stored is 16.
You have tried to clear the screen without saving the current form.
You have tried to exit from the Block menu without pasting, copying or storing the visible block.
You have tried to insert a line above a field or group on the 25th line.
You tried to delete a line that contains a field or a group.
A disk error occurred when Screens tried to close the file.
A disk error occurred when Screens tried to create a file. Possible reasons for this include the disk being full, or the failure to find the specified disk.
The file specified could not be found.
Possible disk error. Possible causes for this include the disk being corrupt or the file being locked.
Disk error. Possible causes for this include the disk being full or the file being locked.
You have requested to exit Screens. Pressing Y or y exits Screens.
You have requested to exit Screens without saving a form. Press Y or y to exit Screens without saving the form.
You have tried to define a field overlapping an existing field.
You have tried to unmark a key field that had not been marked.
You have exceeded the limit for the maximum number of data entries a screen can contain. This limit is 200.
You have tried to work with a file that already exists.
You have specified a file that Screens cannot find.
You have tried to generate COBOL for a form that has changed since it was last changed.
You have tried to change the size of a field in a group. This is not allowed. You must first delete the group definition.
You have tried to define one group in such a way that it would overlap another.
You have tried to define a group within a group. This is not allowed.
You have specified an accept order character that is not in the correct range. Valid characters are 0-9, A-Z and a-z.
You have tried to define keys for a form in the wrong order. You must define keys in the following order:
You have tried to generate an index program where a key field does not have a user-defined name. Assign the field a name using the FROM, TO or USING Screen Section clauses.
System error. Reboot your machine to free any memory. If this error still occurs after rebooting, contact Technical Support who will try to help you to discover the cause of the error.
You have tried to delete a field that is part of a group. You must first delete the group definition.
You have tried to define a field when the cursor is not on a marked block or a caret.
System error. Contact Technical Support who will try to help you to discover the cause of the error.
You have tried to define a group that is invalid. A marked area must be active and must not split any fields or include any existing group definitions. The area must contain at least one field.
You have tried to insert a character at the cursor position when there is a field definition blocking the way.
You have selected a function that is not valid for the block you have marked.
Screens was unable to load the file you specified, possibly because it was unable to read the disk.
You have asked to load a form when the current form has changed since it was last saved. Continue to load the new form will lose the changes you have made to the current form since you last saved it.
You have tried to generate an index program without marking any index fields.
You have not specified a block for a function that requires one.
You have tried to restore a block when you have not previously saved any blocks.
You have tried to delete a field that does not exist.
You have tried to define a group but the marked area does not contain at least one field.
You have tried to delete an occurrence of a group when there is only one occurrence of the group on the form.
You have tried to enter an accept order character when the cursor is not on a field.
You have tried to mark a key field out of numerical order. The prime key must be defined first, followed by the three alternate keys in numerical order.
You have tried to overwrite a field. This is not allowed.
Screens was unable to save the file you specified, possibly because of a disk error.
You have tried to mark a key that is not an elementary item.
You have reached the last row or column on the screen.
You have specified file format that is not recognized, resulting in a load failure.
An undefined system error has occurred. Contact Technical Support who will try to help you to discover the cause of the error.
Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
Mouse Support for Character Interfaces | Using Screens |