KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Invoking TRACE on demand from the keyboard
PRODUCT: 4D | VERSION: 11.5 | PLATFORM: Mac & Win
Published On: January 15, 2010
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

When debugging an application it can be very helpful to have a way to invoke the TRACE command ad hoc from the keybaord. Stepping through numerous breaks at a TRACE command can be maddening. Add the method below at any place in your code that you would like to add the TRACE command. This example method is called DTrace.

This method is most helpful when a developer is observing the execution of an application and trying to debug a method or series of methods after certain conditions have been observed or are anticipated to exist. By using DTrace instead of TRACE, a developer can let the code of interest run uninterupted until the key combination is pressed. This way the TRACE command will only be invoked when it is really necessary.

`***************************************************
`// Method Name: DTrace
`//
`// Purpose: A custom TRACE command wrapper
`***************************************************


If (Shift down & (Macintosh option down | Windows Alt down))
   TRACE
End if