4D v16.3

TRACE

Home

 
4D v16.3
TRACE

TRACE 


 

TRACE  
Does not require any parameters

You use TRACE to trace methods during the development of a database.

The TRACE command turns on the 4D debugger for the current process. The Debugger window is displayed before the next line of code is executed, and continues to be displayed for each line of code that is executed. You can also turn on the debugger by pressing Alt+Shift+right-click (Windows) or Control+Option+Command+click (Macintosh) while code is executing.

In compiled databases, the TRACE command is ignored.

4D Server: If you call TRACE from a project method executed within the context of a Stored Procedure, the debugger window appears on the Server machine.

Tip: Do not place TRACE calls when using a form whose On Activate and On Deactivate events have been enabled. Each time the debugger window appears, these events will be invoked; you will then loop infinitely between these events and the debugger window. If you end up in this situation, Shift+click on the No Trace button of the debugger in order to get out of it. Any subsequent calls to TRACE within the process will be ignored.

Example  

The following code expects the process variable BUILD_LANG to be equal to “US” or “FR”. If this is not the case, it calls the project method DEBUG:

  ` ...
 Case of
    :(BUILD_LANG="US")
       vsBHCmdName:=[Commands]CM US Name
    :(BUILD_LANG="FR")
       vsBHCmdName:=[Commands]CM FR Name
    Else
       DEBUG("Unexpected BUILD_LANG value")
 End case

The DEBUG project method is listed here:

  ` DEBUG Project Method
  ` DEBUG (Text)
  ` DEBUG (Optional Debug Information)
 
 C_TEXT($1)
 
 If(◊vbDebugOn) ` Interprocess variable set in the On Startup Method
    If(Is compiled mode)
       If(Count parameters>=1)
          ALERT($1+Char(13)+"Call Designer at x911")
       End if
    Else
       TRACE
    End if
 End if



See also 

NO TRACE

 
PROPERTIES 

Product: 4D
Theme: Language
Number: 157

Different in remote mode

 
HISTORY 

Created: < 4D v6

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)