Database Solutions - Hints & Tips

Tip 22:
Trace Print

The new debugger available with UNIFACE 7.2.04 allows the setting of several different trace levels. These are additional to the i/o messaging levels, and log to the message frame such things as:

  • entry and exit from each trigger
  • the $procerrorcontext when a transient or non-transient proc error occurs
  • errors on execution of an ACTIVATE statement

The normal way to set the level of tracing is through the Tracing tab of View|Settings in the debugger:

tip_image_01.gif (27830 bytes)

However, the undocumented proc function $traceprint also allows you to set the trace levels. This works on a bitmask principle as follows:

Trace Function Bit Value
Validation 1 1
Triggers 2 2
Transient ProcErrors 3 4
ProcErrors 4 8
Activate Errors 5 16
Proc Tracing Not Available

To select a set of trace functions using $traceprint, simply add the relevant values together and assign to $traceprint. For example, to set all trace options, use:

$traceprint=31

If you use proc code in your application to set $traceprint and then start the debugger, you will see the relevant boxes ticked in View|Settings|TracingTab. You can also set a watch on $traceprint to check its current value.

What UNIFACE puts in the message frame for each of the trace functions is not the subject of this Tip, but it’s worth mentioning that my experiments shed more smoke than light. The Validation function seems to do what you’d expect the Trigger function to do. The Trigger function does nothing. The Activate Errors function apparently worked whenever eight or above was assigned to $traceprint. And it’s very difficult to unscramble what is happening with the Transient and Non-transient ProcErrors.

Hopefully all this will get resolved by version 8!

compuware_01.gif (3977 bytes)


Copyright ©2000 OCS Consulting plc

dbs_block_logo.gif (2150 bytes)
Refresh Frames