|
|
Enhanced ACCEPT/DISPLAY Syntax | |
MERANT provides many methods for creating user interfaces in both
character and graphical environments. Your Net Express Help contains
details on creating graphical user interfaces.
This on-line book introduces you to the tools that are available within
Net Express for creating character user interfaces. These include:
- Adis.
- Keybcf.
- Panels.
- Character screen routines.
- Windowing syntax.
- On-line help.
These specialized features make it easy for you to create sophisticated
and user-friendly character user interfaces for your applications. They
are provided for backwards compatibility only, so we recommend that you do
not use them when creating new applications.
- Enhanced ACCEPT and DISPLAY syntax - The enhanced ACCEPT/DISPLAY
syntax enables screen position and screen attributes to be specified.
You can do either single-field or multiple-field ACCEPT operations. For
multiple field ACCEPT operations, FILLER describes the number of
character positions to skip over to the next field. In a DISPLAY
operation, FILLER defines the number of spaces between literals. All
areas defined as FILLER are unaffected by the ACCEPT or DISPLAY
operation.
- ANSI ACCEPT and DISPLAY syntax - The ANSI ACCEPT syntax enables you
to input a data item or accept the day, date or time into a data item.
The ANSI DISPLAY syntax enables you to output literals and the contents
of data items.
- Panels provides comprehensive text windowing support using a call
interface. Any number of windows can be created and manipulated from a
COBOL program, with up to 255 visible at a time. A comprehensive range
of functions for manipulating a panel is provided; for example,
scrolling, block updates of characters and attributes, moving the panel,
and changing the size of the visible area. Output from the Adis module
(supporting enhanced ACCEPT and DISPLAY syntax) can be directed to a
panel using the call interface.
- The Screen Section is a section in the Data Division containing one
or more screen definitions. A screen definition can contain fields,
groups, text and attributes. Fields can have edited picture-strings and
can also have such features as NO-ECHO, JUSTIFIED RIGHT and BLANK WHEN
ZERO. The screen definitions are accepted and displayed in the Procedure
Division.
- Low level - COBOL system library routines - The low-level interface
is supplied by the COBOL system library routines. These routines enable
you to access low level functionality from a COBOL program.
- Windowing syntax - Your COBOL system supports syntax for drawing
lines and boxes on the terminal screen, and for creating virtual
terminal windows on a physical terminal.
The enhanced ACCEPT/DISPLAY syntax enables screen position and screen
attributes to be specified. You can do either single-field or
multiple-field ACCEPT operations. For multiple field ACCEPT operations,
FILLER describes the number of character positions to skip over to the
next field. In a DISPLAY operation, FILLER defines the number of spaces
between literals. All areas defined as FILLER are unaffected by the ACCEPT
or DISPLAY operation.
The enhanced ACCEPT/DISPLAY and Screen Section ACCEPT/ DISPLAY
operations use a run-time support module called Adis, or enhanced
ACCEPT/DISPLAY syntax. Adis can be configured to an application's
requirements using the configuration utility Adiscf. Calls can also be
made from the COBOL application to Adis to configure it at run time; for
example, to enable function keys.
Advantages
- Can specify position of ACCEPT/DISPLAY operation
- Can accept/display one or more fields
- Can specify attributes for ACCEPT/DISPLAY operation
- Formatting of numeric fields during input
- RM compatible (using RM directive), MS 2.2 compatible (using MS"2"
directive), and X/Open compatible
Disadvantages
- Not portable across all COBOL dialects
- Can take up large amounts of memory loading Adis
- FILLER items used when accepting more than one field waste space
The ANSI ACCEPT syntax enables you to input a data item or accept the
day, date or time into a data item. The ANSI DISPLAY syntax enables you to
output literals and the contents of data items.
Advantages
- Portable across all COBOL dialects
- No overhead of the ACCEPT/DISPLAY module, Adis.
Disadvantages
- No positional information can be specified
- No attributes can be specified
- Field type on an ACCEPT operation is treated as alphanumeric - any
characters can be entered into a field even if it is defined as numeric
- Only a single field can be input by one ACCEPT statement
Comment
Only for elementary screen output and keyboard input.
Panels provides comprehensive text windowing support using a call
interface. Any number of windows can be created and manipulated from a
COBOL program, with up to 255 visible at a time. The visible part of a
panel occupies a rectangular area of the screen which can be as large as
the physical size of the screen. Each panel can contain up to 65,536
characters. A comprehensive range of functions for manipulating a panel is
provided; for example, scrolling, block updates of characters and
attributes, moving the panel, and changing the size of the visible area.
Output from the Adis module (supporting enhanced ACCEPT and DISPLAY
syntax) can be directed to a panel by using the call interface.
Advantages
- Provides text windowing
- Blocks of text and attributes within a panel can be scrolled
- Panels can be moved around the screen
- The visible area of a panel can be changed
- Compatible with ACCEPT and DISPLAY syntax
Disadvantages
- Can use a lot of memory if many large panels are created
- Additional disk and memory resource is used by the Panels module
- ACCEPT and DISPLAY operations are slightly slower than when used
directly on the screen
The Screen Section is a section in the Data Division containing one or
more screen definitions. A screen definition can contain fields, groups,
text and attributes. Fields can have edited picture-strings and can also
have such features as NO-ECHO, JUSTIFIED RIGHT and BLANK WHEN ZERO. The
screen definitions are accepted and displayed in the Procedure Division.
Advantages
- Only writes to the specified areas of the screen, leaving other areas
unaffected
- Can specify position of screen and its text and data
- Can accept/display one or more fields and groups
- Can specify attributes for ACCEPT/DISPLAY operation
- Can specify field input acceptance order
- More readable presentation of the screen's layout because all
information relevant to a particular screen is in one place and the
syntax is easily understood
- Only the parts of the screen specifically defined are stored (as
opposed to the enhanced ACCEPT/DISPLAY method which can involve using
FILLER items which take up memory)
- Data General (DG) compatible (using DG directive), MS 2.2 compatible
(using MS"2" directive), X/Open compatible
Disadvantages
- Not portable across all COBOL dialects
- Marginally slower than the multiple-field ACCEPT if a screen contains
a lot of text and data
- Memory overhead of ACCEPT/DISPLAY module
Comment
Useful if you want to have your screen definitions in a single place in
the Data Division and want your applications to be X/Open compliant.
The low-level interface is supplied by the COBOL system library
routines. These routines enable you to access low level functionality from
a COBOL program. The example below shows only one method of putting text
and attributes on the screen. Many other calls exist to access screen and
keyboard functionality.
Advantages
- Fast - operating system level interface
- No overhead of Adis module
Disadvantages
- Can require many calls to build up a complete screen
- Parameters can be complicated. For example, offsets might need to be
calculated
Comment
Useful if you specifically want to exploit the features of your machine
and operating system, or if you require minimal memory overheads for your
screen handling. Note that complicated screens might require many calls to
these routines.
Your COBOL system supports syntax for drawing lines and boxes on the
terminal screen, and for creating virtual terminal windows on a physical
terminal. All ACCEPT and DISPLAY statements then act within the current
window (except for ACCEPT format 1, 2, or 3 statements, DISPLAY format 1
statements, and DISPLAY WINDOW/LINE/BOX statements). The syntax also
enables underlying displays to be kept and restored.
Advantages
- Adds text windowing to COBOL
- Requires no additional software
- Makes it easy to draw forms on the screen
Disadvantages
- Not portable across all COBOL dialects
- Cannot be used with calls to Panels in the same run unit
Comment
Useful if you want a simple way of adding text windowing to a COBOL
application.
Copyright © 2000 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
|
|
Enhanced ACCEPT/DISPLAY Syntax | |