trace help (a tiny detail)

Discussions about editing and cleaning data
Post Reply
AriSilva
Posts: 470
Joined: July 22nd, 2016, 3:55 pm

trace help (a tiny detail)

Post by AriSilva » January 15th, 2021, 2:01 pm

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 » January 15th, 2021, 3:11 pm

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: 470
Joined: July 22nd, 2016, 3:55 pm

Re: trace help (a tiny detail)

Post by AriSilva » January 19th, 2021, 10:05 am

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 » January 19th, 2021, 10:07 am

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 » January 19th, 2021, 10:26 am

Is this in CSEntry or in CSBatch?

Gregory Martin
Posts: 1418
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: trace help (a tiny detail)

Post by Gregory Martin » January 19th, 2021, 1:00 pm

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 » January 19th, 2021, 1:24 pm

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: 470
Joined: July 22nd, 2016, 3:55 pm

Re: trace help (a tiny detail)

Post by AriSilva » January 20th, 2021, 9:04 am

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