Defining Variables [ HP ALLBASE/4GL Developer Self-Paced Training Guide ] MPE/iX 5.0 Documentation
HP ALLBASE/4GL Developer Self-Paced Training Guide
Defining Variables
You can now create a variable called product_status. This variable is
set after a file access to indicate if a record exists or not.
Menu Path
To access this screen from the main menu:
1. Select the Dictionary option.
2. Select the Storage Items option.
3. Choose Variables.
Description
Variables have a fixed length and type. When an application starts,
alphanumeric variables are initialized to spaces and numeric variables to
zero. Variables are not initialized at any other time.
Variables Screen
To enter the field values:
Field Entry Explanation
---------------------------------------------------------------------------------------
Variable Name product_status When referred to in the application, a
variable is always prefixed with V-. The
full reference to this variable is V-
product_status.
Length 1 The length of a variable is fixed, and the
maximum possible length is 99 characters.
Edit Code X This edit code has the same definition as
all other edit codes.
Number of Decimal Leave blank. Variables can use up to nine decimal places
Places if they are numeric.
Pad Character Leave blank. HP ALLBASE/4GL automatically justifies a
variable when it receives a value.
Alphanumeric variables are left justified,
and numeric variables are right justified.
This field allows you to specify a pad
character which is used to fill the
remaining spaces in the variable after it
has been justified. The pad character must
be a valid character for the edit code
specified.
To create the variable:
1. Press the Commit Data function key.
Defining the Mode Variable
Next, you will create a second variable called mode, which will be used
to indicate the current update mode (one of Add, Modify, Delete, or
Review).
To define the mode variable:
1. Enter the values for fields shown below that require an entry.
2. For all other fields, simply press the Return or Tab key to accept
the default.
Field Entry
----------------------
Name mode
Length 6
Edit Code X
To create this variable and continue:
1. Press the Commit Data function key.
2. Then press the Previous Menu function key to return to the
storage items menu.
MPE/iX 5.0 Documentation