Debugger

This Section Contains

Description

Turning the Debugger On

Turning the Debugger Off

Using the Debugger

Debugger Options

Running Operations

Finding Values

Isolating Errors

Testing New Statements

5.0 Enhancements

Description

Once engaged, the debugger allows you to step you through your processing tables one step or one-half step at a time.

A step for debugger purposes is considered to be one if-then element of a processing table. However, it is very important that you realize where the debugger is pausing to allow you to examine the process. It stops after testing the "If" condition of each element and allows you to enter debugger commands until you press RETURN and cause it to execute the "Then" line.

Turning the Debugger On - Three ways:

While on line in dclerk by pressing "!b" at the Enter Selection prompt. Nothing will appear to happen, but the next time you press U for Update the debugger will be engaged.

From within processing, by putting the DEBUG command on the appropriate line in the processing table.

Syntax:

Then: DEBUG ON

Example:

If:
Then: input q(1,yesno) "Turn debugger on? (Y/N):"
If: q="Y"
Then: debug on

3. From the operating system command line (or menu action line) by using the flag -db.

Example:

/appl/fp/program filename -db

Turning the Debugger Off - Two ways:

1. While on line in dclerk or dreport by pressing a "q" at the Enter command prompt.

2. From within processing, by putting the DEBUG command on the appropriate line in the processing table.

Using the Debugger

Steps

1. From the Inquire, Update, Add option line, press "!B".

2. Press "U" to update.

3.Debugger appears at bottom of screen.

Layout

True--------------------------------------Prc. Name: automatic
If:
Then:

Enter Command >

Prompts

 Prc.Name:      the current table

 True/False     shows the result of testing the current "If" line

If:            the current element
Then:

Enter Command >     your debugger command

 

Debugger Options

Looking

 

L = Look

Lists the processing one line at a time without executing any of the actions.

ARROWS

Moves you up or down in the table

F = Find label

Enter a label name. Program goes to that label and returns to the "look" options. Use arrows or press RETURN to go back to start.

N = Line Number

Enter an element number.

P = Print

Prints the selected lines.

RETURN

Returns you to the line from which you started.

DELETE

Returns you to the line from which you started.

 

Running Operations

 

RETURN

Executes the element shown and shows the next element and the value of its condition. Redraws the screen and displays changed data.

S = Single Step

Executes the element shown and shows the next element and the value of its condition.

D = Display

Displays results, on the screen, of the processing up to that point.

H = Half Step

Like "S" except that the next condition is not executed.

 

Finding Values

 

F = Field

Enter a field number, a dummy field letter, or a system maintained field and the value will be returned.

E = Expression

Evaluate expressions and show the result. It can be used to see the contents of fields just like the "E" command.

It can also show you the value of any expression containing fields. (3 * 4) Any valid expression can be tested.

Another useful expression is a lookup field. Type filename(n) on the command line and the value is returned.

Literals can also be part of a valid expression so you could test values such as this: (3 + 4/"2.2").

Date math can also be done using the e command.

 

Isolating Errors

 

B = Break

Stops the processing at the point indicated. You may stop and start the debugger, testing along the way. There are three ways to set break points:

N = Number

Stop at the designated line number. Maximum of eight.

C = Condition

Stop when the designated condition is met.

F = Field

Stop when the designated field changes value.

C = Continue

Runs the processing table through until it reaches a break point. Changing from one table to another (automatic to input) constitutes a logical break point.

I = Ignore

Ignores any break points for the remainder of the current record.

R = Remove

Removes line number break points.

 

Testing New Statements

 

A = Action

Write and test new actions. The "A" command is very useful for testing situations that don’t exist on the record you are examining. The best use is for "what-if" testing. You can for instance set a date to a certain day to test particular date processes and so on.

Q = Quit

Turns off the debugger and returns you to normal program control.

DELETE (Break)

Use to break out of specific operations.

F10 Help

Displays the debugger help screen.

5.0 Enhancements

F8 (Extended functions) provides additional debugging options as follows:

5.8 Enhancements

Break points will now accept long variables  (The scope of a longvar is different from a normal dummy field. Technically, longvar is not at a true global scope, and isn't available in the automatic processing table.  Declaring it 'g' only will work       across records, but not tables, declaring it GLOBAL will fix that, but it has to be matched with an  EXTERN in the other prc table.

L

Displays all lookups within the processing table, along with their status e.g. closed, failed, or open.

F

Displays all open files.

"*"

An asterisk marks which is the current lookup for a given alias.