Ch 4. Defining Application Logic [ HP ALLBASE/4GL Developer Self-Paced Training Guide ] MPE/iX 5.0 Documentation
HP ALLBASE/4GL Developer Self-Paced Training Guide
Chapter 4 Defining Application Logic
Logic
So far you have defined a number of field specifications and used them to
create a data file and a data screen. The basic data requirements for
this part of the application are now complete. Now you are ready for
Phase 4 - defining the logic required to make the application run.
HP ALLBASE/4GL uses logic constructs called processes, functions, and SQL
logic blocks. The lessons in this chapter describe the techniques to
develop a process and a function so you can get your application running.
If you are developing the HP ALLBASE/SQL based application, you will also
develop an SQL logic block.
The screens you will learn how to use include:
* Process Header Screen
* Process Details Screen
* Function Header Screen
* Function Details Screen
* SQL Logic Block Header Screen
* SQL Logic Block Details Screen
What Are Processes and Functions?
A process is similar to a program in a conventional language. When a
process starts, HP ALLBASE/4GL initializes the environment to a known
state. It closes all data files, clears all data buffers, and terminates
any current non-background process, screen, function, report, or decision
table.
A function is similar to a conventional subroutine. A function can be
called from many places without automatically affecting the current
environment. When a function is complete, the application returns to the
place from which the function was called.
Processes and functions are collectively referred to as logic blocks.
They both share the same constructs and generally the same commands.
They each have a maximum of 99 lines of commands, and are created by
entering the details of each line into formatted windows on HP
ALLBASE/4GL screens. Using windows means that you don't need to remember
the exact syntax for every command.
What Are SQL Logic Blocks?
SQL logic blocks are the means of communicating with HP ALLBASE/SQL
tables. SQL logic blocks are called from processes and functions to
perform specific HP ALLBASE/SQL commands. For example, you may use the
HP ALLBASE/SQL SELECT command to declare and open a cursor on an HP
ALLBASE/SQL table.
An SQL logic block can contain up to eight SQL commands. At run-time,
the commands in an SQL logic block are invoked by a command in an HP
ALLBASE/4GL logic block.
MPE/iX 5.0 Documentation