HP 3000 Manuals

Phases of Application Development [ HP ALLBASE/4GL Developer Reference Manual Vol. 1 ] MPE/iX 5.0 Documentation


HP ALLBASE/4GL Developer Reference Manual Vol. 1

Phases of Application Development 

HP ALLBASE/4GL does not impose many restrictions on the procedure you
must use to develop applications.  The principal restriction is that you
must define most dictionary items before you can use them in other areas
of HP ALLBASE/4GL.

Typically you will create applications in five phases as follows:

   *   Phase 1 - Planning.

   *   Phase 2 - Data definition.

   *   Phase 3 - Screen development.

   *   Phase 4 - Logic definition.

   *   Phase 5 - Report definition.

Planning Your Application 

The first step is to define the requirements of your application.  As
with any conventional third generation language system, the best thing to
do is to get well away from your terminal and sit down with pencil
and paper.  As part of the task, you need to identify the field
specifications, record layouts, and data files the application needs.

Data Definition 

The next step is to use the HP ALLBASE/4GL dictionary facilities to
define the application components you have identified.  Once you have
defined the necessary field specifications and record layouts, you can
build the application data files from within HP ALLBASE/4GL.

The HP ALLBASE/4GL dictionary contains the following types of entries:

   *   Field specifications.

   *   Validation items.

   *   Storage items.

   *   Record layouts.

   *   Database items.

   *   Messages.

   *   Help screens.

Field Specifications.   

A dictionary field specification defines the attributes of a field in a
file, a screen, or a report.  Since field specifications are stored in
the dictionary, the definitions of fields on screens and reports can
refer to these central specifications.

The HP ALLBASE/4GL dictionary field specifications do not contain any
application data in themselves.  They are simply templates that define
the characteristics of a field.

The dictionary field specification defines the following characteristics
for a field:

   *   The field specification name.

   *   The length of the field and the number of times it is repeated.

   *   The edit code and justification codes for the field.  These codes
       determine the type of data (for example, numeric, alphanumeric
       etc.)  that the field can hold, and how it is presented on the
       screen or a report.

   *   The names of any validation tables or ranges used to validate data
       for this field.

   *   The pad character used to fill unused spaces at the beginning or
       end of the field.

   *   The external storage type for the field.

   *   Any data manager specific attributes required for the field.

Validation Items.     

The dictionary validation items are either validation tables or
validation ranges.  A validation table is a table of values used to test
input data for a field.  A validation range specifies the lower and upper
limits for a range of acceptable values for a field.

Storage Items.     

The HP ALLBASE/4GL dictionary storage items are somewhat different from
the other dictionary entries.  In contrast to the dictionary field
specifications, the storage items do hold application data.  The HP
ALLBASE/4GL dictionary storage items are:

   *   Variables.

   *   Calculated items.

   *   Numeric constants.

   *   Alphanumeric constants.

   *   Scratch-pad field names.

   *   Work areas.

   *   Application titles.

HP ALLBASE/4GL calculated items are variables that are evaluated each
time they are called by an application.  The value of a calculated item
is the result of an arithmetic expression or function that is evaluated
when the item is referenced.

The HP ALLBASE/4GL scratch-pad contains 100 scratch-pad fields.
Scratch-pad fields are temporary storage areas that you can use for
storing data within an application.  HP ALLBASE/4GL allocates memory for
the scratch-pad dynamically.  Each scratch-pad field takes on the
attributes of the data written into it, and the combined scratch-pad uses
only the amount of memory required to hold the data contained within it
at any given time.

HP ALLBASE/4GL work areas are memory buffers that are similar to file
record buffers.  However, work areas are not associated with a data file.

Record Layouts.   

The record layout definitions in the HP ALLBASE/4GL dictionary define the
names and sequence of fields within file records.  The record layout
definitions also define the fields in the records that are used as keys
for reading records from indexed data files.  The HP ALLBASE/4GL data
manager uses the key fields to build the file indexes when you create
indexed data files.

Database Items.   

The dictionary database items include the definitions of HP ALLBASE/SQL
tables and select lists, HP TurboIMAGE/iX data sets, KSAM data files, and
serial data files.  Once these databases items are defined, you can
physically create HP ALLBASE/SQL tables and select lists, KSAM data
files, and serial data files from within HP ALLBASE/4GL.

Messages.   

HP ALLBASE/4GL allows you to use a number of different types of messages
to communicate with application end users.  Messages can be simple
literal strings, or combinations of items including literals, variables,
constants, and screen field data.

All messages have a code to indicate the action to be taken by the user
or HP ALLBASE/4GL. You can define message codes ranging from prompts or
information, to queries, warnings, errors, and aborts.

Help Screens.   

HP ALLBASE/4GL allows you to associate a help screen with each
application screen, and with each field on a data screen.  The dictionary
help screen definition contains the help screen name, and the text of the
screen.  The Screen Header screen and the Screen Field Details screen in
the screen development menu allow you to associate help screens with an
application screen or a particular field on an application screen.

You can link one or more further help screens to a help screen if you
need to present more information than one screen can contain.

Screen Development 

HP ALLBASE/4GL supports three types of application screens:  menus, data
screens, and windows.  The procedure for creating screens is essentially
the same for all types of screens.  All the HP ALLBASE/4GL screen
development facilities are accessed through the screen development menu.

The first step is to complete the screen header for an application
screen.  The Screen Header screen, accessed via the screen development
menu, allows you to assign a name to the application screen and define
its characteristics.

You can now use the HP ALLBASE/4GL screen painter to create the screen
image.

The next stage is to complete the screen field details screen for the
input and output fields on data screens and windows.  This screen allows
you to define the attributes of the input and output fields, and the
various fields for data movement to and from the screen.  This step is
not needed for a menu.

You can associate one or more sets of function keys with each application
screen.  The function keys definition screen allows you to define the
text and actions for the function key sets associated with application
screens.

You may also automatically create a screen when you use the module
builder.  The module builder is a tool within HP ALLBASE/4GL that
automatically creates a screen and the logic required to maintain a file
or retrieve file record details.

Logic Definition 

HP ALLBASE/4GL supports four types of logic structures:  processes,
functions, SQL logic blocks, and decision tables.

You may automatically create a process, functions, and SQL logic blocks
when you use the module builder.

Processes and Functions.   

A process is similar to a program in a conventional language.  A function
is similar to a subroutine in a conventional language.

Processes 

When a process starts, HP ALLBASE/4GL initializes most of the
environment.

When a process starts, the following occurs:

   *   All HP ALLBASE/SQL cursors, HP TurboIMAGE/iX data sets, and
       application data files are closed.

   *   All file record buffers, work areas, and screen buffers are
       cleared.

   *   Any current process, function, screen, decision table or report is
       terminated.

   *   Any incomplete HP ALLBASE/SQL transaction is reversed.

At the start of a process, the content and state of the following remains
unchanged:

   *   Communication area fields, except for *PROCESS.

   *   Scratch-pad fields.

   *   Switches.

   *   Variables.

When a process terminates, control will return only to a menu.  This
means, for instance, that if a decision table action executes a process,
control will not return to the decision table when the process has
completed.  If there is no menu to return to, the application terminates.

Functions 

When a function is completed, HP ALLBASE/4GL resumes running the
application at the point where the function was initiated.

Functions can be nested.  That is, one function may initiate another
function.

HP ALLBASE/4GL processes and functions consist of a number of
instructions that make up the logic block of the function or process.
Each logic block can contain up to 99 lines of instructions where each
instruction contains one or more logic commands.  HP ALLBASE/4GL has a
set of about 40 logic commands.

SQL Logic Blocks.     

SQL logic blocks allow HP ALLBASE/4GL and HP ALLBASE/SQL to communicate.
An SQL logic block can contain up to eight HP ALLBASE/SQL commands.  At
run-time, the commands in an SQL logic block are invoked by an SQL
command in an HP ALLBASE/4GL logic block.

Decision Tables.     

Decision tables can be used to implement more complex conditional testing
than is available using the IF and IFLOOP logic commands.

A decision table can test up to eight questions or conditions, and
initiate up to eight actions.  Each decision table can test up to 31
different combinations of outcomes for the eight decision table
questions, and for each combination of outcomes, execute some or all of
the eight decision table actions in a specified order.

The decision table actions can include processes, functions, screens, and
reports.

Report Definition 

The next stage in the application development process is to define the
reports.  All the HP ALLBASE/4GL report generation facilities are
accessible from the reports menu.

The HP ALLBASE/4GL report generator reports on the contents of one
primary file.  Typically, this file is the result of a query (a SELECT
command) on an HP ALLBASE/SQL database.  If necessary, you can specify
further selection criteria to limit the records selected from the file.
You can also specify additional sorting before the report is printed.
The report generator also allows you to define linkages to other types of
files to read information for reporting.  The report generator also
allows you to define the report layout, totalling, and any special logic
requirements for the report.

HP ALLBASE/4GL reports consist of a number of different line groups.
Line groups are available for page headings, bottom of page lines, column
headings, subheadings, subtotal lines, and the normal detail lines that
are printed for each file record selected for reporting.

The procedure for defining the layout of a report is similar to the
procedure for laying out a screen.  The HP ALLBASE/4GL report generator
includes a report painter.  The painter allows you to paint report lines
exactly as they will appear on the final printed report.



MPE/iX 5.0 Documentation