trace help (a tiny detail)

Discussions about editing and cleaning data
Forum rules
New release: CSPro 8.0
Post Reply
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

trace help (a tiny detail)

Post by AriSilva »

In activating and disabling it is written "...If the filename does not contain a dictionary, the file will be placed in the application folder".
Instead of "dictionary", shouldn't be "directory"?

Now a question:
If I use the set trace(on), in one of the variables, or in the preproc of the _FF, is it valid for all the functions in the program? Or do I have to set trace(on) inside each function?
Best
Ari
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: trace help (a tiny detail)

Post by josh »

The trace(on) setting is global so if you set it once it will remain on until you explicitly turn it off by calling trace(off).

Thanks for the correction in the help.
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

Re: trace help (a tiny detail)

Post by AriSilva »

That´s interesting, because I set
set trace(on);
in the preproc of the form
PROC xxxxxx_FF
trace(on, "trace.txt", clear);
set trace(on);

It traces the executed statements in this proc, but as soon as it enters a function it stops tracing, UNLESS I put another
set trace(on);
in the very first executed function
Best
Ari
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: trace help (a tiny detail)

Post by josh »

Unless you have a trace(off) somewhere that sounds like a bug. I'll see if we can reproduce it.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: trace help (a tiny detail)

Post by josh »

Is this in CSEntry or in CSBatch?
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: trace help (a tiny detail)

Post by Gregory Martin »

The location of set trace is a compile-time, not runtime, setting. If you don't have it in your program's logic before the definition of your functions, then those functions won't be traced (because their logic won't be built into your compiled application).

Generally if you want to trace logic, you put the command right after PROC GLOBAL:
PROC GLOBAL

set trace
(on);
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: trace help (a tiny detail)

Post by josh »

I didn't realize you were using "set trace". I didn't even know that existed. I was referring to just "trace(on)" which is global. As Greg, set trace(on) is something different.
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

Re: trace help (a tiny detail)

Post by AriSilva »

Thanks Greg and Josh,
I thought that setting it at the beginning of the program (like in the preproc) would do the job, but Greg clarified this issue perfectly.
I did not realize this function was being set at compile-time.
As a suggestion, maybe this should be stated in the help.
Best
Ari
Post Reply