Page 1 of 1

logmode error line number

Posted: Thu Sep 10, 2015 11:16 am
by troy_walters
I am trying to debug a large prg. The program stops with an error. I am trying to locate the offending line. I am using:

Code: Select all

logmode -p error -hideprogline
to log the errors. However this only gives the the line in which the error occurs, not the line number. How do I get it to show me the line number instead of just the line itself?

Re: logmode error line number

Posted: Thu Sep 10, 2015 11:22 am
by EViews Gareth
Unfortunately you cannot. The way that EViews handles includes, execs and subroutines means that it is, currently, impossible for EViews to know the line number currently being executed.

Re: logmode error line number

Posted: Thu Sep 10, 2015 11:44 am
by troy_walters
Ouch. Is this something that will be added in the future?

Re: logmode error line number

Posted: Fri Sep 11, 2015 8:31 am
by EViews Jason
Not anytime soon.

The docs are not correct and will be updated. As you have already discovered, it currently reads
[Hide/Do not hide] the program line number when reporting errors encountered during execution.
It should read
[Hide/Do not hide] the program line when reporting errors encountered during execution.
This isn't as helpful as having line numbers, but you can sporadically add your own custom messages to the program log using 'logmsg'.

I would add several calls to logmsg around where you think the problem made be occurring. Here is an example on how to use logmsg:

Code: Select all

logmode logmsg logmsg creating workfile create u 10 logmsg creating 2 series series x=rnd series y= x+1 logmsg entering for loop for !i=1 to 10 %s = @str(!i) logmsg %s next logmsg finished