Using Trace Mode [ HP ALLBASE/4GL Developer Self-Paced Training Guide ] MPE/iX 5.0 Documentation
HP ALLBASE/4GL Developer Self-Paced Training Guide
Using Trace Mode
When you first test your application it may not appear that all of the
activity you have defined has actually taken place. Trace mode enables
you to see it all.
HP ALLBASE/4GL has a trace mode to help you test your applications. It
lets you see each step of your application as you test it, by displaying
a line-by-line description of the logic being executed as the application
runs.
To use trace mode:
1. Press the Previous Menu function key to return to the main menu
of the training application.
2. Then follow the next steps:
Action Explanation
----------------------------------------------------------------------
Press System Keys A new function key set is displayed.
Press More Keys Another set of function keys is displayed.
Press Trace Mode This key turns the trace mode on. An
asterisk appears in the function key label
indicating that trace mode is now on. When
you want to turn trace mode off again,
simply press the function key again.
With trace mode on, you will now go through the procedure to add a
product file entry again. This time you will see every logic block line
echoed at the base of the screen as the application runs.
To check the application activity:
1. Activate the Product Details menu item.
The first line of the product_proc process is displayed at the
bottom of the screen in the following format:
P-product_proc: 1:MODE:MODE *WRITE product
or, for HP TurboIMAGE/XL based applications,
P-product_proc: 1:DM:DM IMAGE *MODE *MODLOCK :D-traindb
The colons (:) separate the four parts of a trace statement. The
four parts of a trace statement are:
a. Logic block type and name. In trace mode, action prefixes
are recognized, so P- indicates a process followed by the
name of the process product_proc.
b. Step number within the product_proc logic block. In the
example above, this is step number 1.
c. Command name. In this case it is the MODE command (or the
DM command for HP TurboIMAGE/XL based applications).
d. The full command line; exactly what appears in the step,
including the command name.
When the line has been executed, an end step message is displayed.
P-product_proc:1:END STEP
The next step, the SCREEN command, is displayed and executed. The
product_scrn screen is displayed.
2. Enter a product number.
After you press Return, the first line of the product_key_read
function is displayed.
The logic for this function differs between data managers. As an
example, the following should occur for KSAM based applications.
F-product_key_read: 1:FILE:FILE *READ product *KEY= *
This shows that HP ALLBASE/4GL is executing the function
associated with this field after you entered data in the field.
When the final step from the function finishes, the cursor moves
to the next field and you can continue with data entry.
If you enter the number of a product_rcrd record that already
exists, the details of that record are displayed by the SHOW
*REFRESH command. If you are developing the HP ALLBASE/SQL based
application, you cannot modify an existing record. If you try to
modify a record, an error will occur.
3. Enter some details for each field, and then press the Commit Data
function key. If you leave any required fields blank, HP
ALLBASE/4GL displays an error message and returns you to the blank
field. Otherwise you will exit from the screen processing and the
following message is displayed:
P-product_proc: 2:END STEP: SCREEN product_scrn
This indicates that you have just completed the SCREEN command and
have returned to the product_proc process. The remainder of the
process is executed (and several messages are displayed) and then
returns you to the start of the process. After the record has
been written to the file, you are returned to the start of the
product_scrn screen. The screen is not cleared at the completion
of the SCREEN command. The screen display is only altered when a
SCREEN command for a different screen is issued, or the user
returns to a previous menu.
_________________________________________________________________
NOTE Trace mode creates a file containing all the lines that are
echoed to the screen while trace mode is active. This file
defaults to a temporary file called HP4TRACE in your current
logon group and account.
_________________________________________________________________
4. To exit from your application, press the Previous Menu function
key twice from the product_scrn screen, or once from the
application main menu.
MPE/iX 5.0 Documentation