Generate Trace File – what does it mean?

In the Applications pad there is an option in the generate/build buttons drop down list to "Generate Trace File"  Today I was wondering what this was and my first thought was that this was the template debug trace file.  But on my development virtual machine I couldn't find one even though I had found that this setting was checked.

So I asked on the Clarion 10 newsgroup and Graham Dawson set me straight on this.  This is indeed settings for the template debug trace file.

Clarion10TraceFiles
Trace File Options in the Applications pad in Clarion 10

There are 3 options there:  generate, don't generate and generate by application settings.  If "Generate Trace File" is turned on, it is generated unconditionally.  If "Don't Generate Trace File" is checked, then it's not generated.  If "Generate Trace File - Default (Application Settings)" is on, then it's only generated if it's set in the Application Options.

Clarion10ApplicationOptionsTraceFiles

 

So what is this Trace File?  It is a file that generates all interactions with templates during generation.  It can grow to enormous size!  For example generating an application with browses and update forms, about 100 procedures, produced a file that was 3.5 GB (yes GB as in GIGA Bytes!) after a single generation!

Obviously those huge files are next to useless for template debugging because of their size and that's where the #DEBUG statement comes in.  The trace file generation can be turned on or off by using #DEBUG(1) to turn it on and #DEBUG(0) to turn it off.  But it's not quite that simple as the value must by in a symbol so you have to do something like this:

#DECLARE(%SetDebug)
#SET(%SetDebug,1)
#DEBUG(%SetDebug)
  #! Some template code here
#SET(%SetDebug,0)
#DEBUG(%SetDebug)

This would then generate just the code in between the #DEBUG statements into the trace file.

The default Trace File name in the Application Options is "C:\tpldebug.txt" and if you force the Trace File generation with the generation/build buttons, it is "C:\tpldebug2.txt"  If you change the filename in the Application Options to just be the filename, without the driveletter, i.e. "tpldebug.txt" the file is generated into the folder where the application is that you are generating.

If you feel that the generation is slower than normal, check to make sure this isn't turned on!  Even on a very fast computer generating the trace file to a SSD drive, it still slows down the generation considerably!

Arnor Baldvinsson

Leave a Reply