logmode error line number

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

troy_walters
Posts: 20
Joined: Thu Jan 15, 2015 9:07 am

logmode error line number

Postby troy_walters » Thu Sep 10, 2015 11:16 am

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?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 12543
Joined: Tue Sep 16, 2008 5:38 pm

Re: logmode error line number

Postby EViews Gareth » Thu Sep 10, 2015 11:22 am

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.
Follow us on Twitter @IHSEViews

troy_walters
Posts: 20
Joined: Thu Jan 15, 2015 9:07 am

Re: logmode error line number

Postby troy_walters » Thu Sep 10, 2015 11:44 am

Ouch. Is this something that will be added in the future?

EViews Jason
EViews Developer
Posts: 785
Joined: Tue Sep 16, 2008 3:50 pm

Re: logmode error line number

Postby EViews Jason » Fri Sep 11, 2015 8:31 am

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


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 10 guests