Hi,
I would like to know if there is a command to get the name (or path) of the program currently being run (for logging purposes, i.e. this series was created in this program). I know how to get the workfile name, path, page names and frequency.
I'm positive i can work my way around this but it would be very helpful to know whether or not such a command exisits.
I did a quick search in the forum to see if this has been asked before, but couldn't find anything similar, yet.
Thanks
get program name or path
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- EViews Developer
- Posts: 563
- Joined: Thu Apr 25, 2013 7:48 pm
Re: get program name or path
Thank you very much!
Re: get program name or path
So this works except in one circumstance. If i have a 'master' program that runs several other sub programs, then the @runpath and @runname commands give me the info of the master program instead of the sub programs.
In other words, i totally missed the part in the link that mentioned 'high-level' program. Is there any way to get around this?
In other words, i totally missed the part in the link that mentioned 'high-level' program. Is there any way to get around this?
Re: get program name or path
I would also add that my programs are now very buggy (after using logmsg and logsave).
They seem to freeze in the middle of the logging, and crash (and need to be closed).
If i take out the logging, they run without problems. Not sure why.
They seem to freeze in the middle of the logging, and crash (and need to be closed).
If i take out the logging, they run without problems. Not sure why.
Re: get program name or path
The programs specifically crash on the logsave line.
I'm generating a string with all the series that i want to log, then log each series individually in the logmsg. generate the location of where the text file will be saved, then saving it.
Here is the code:
string serieslist=@wlookup("*xr*", "series")
group currencymaster {serieslist}
string path=@runpath
string name = @runname
string path=path+name
for %var {serieslist}
%command=%var + ": " + path
logmsg {%command}
next
%datenow = @strnow("yyyy/mm/dd")
%datenow=@replace(%datenow,"/","-")
%chartcodeloc="c:\somelocation\log\log_" + %datenow + ".txt"
''''''''THIS IS WHERE IT FREEZES AND CRASHES
logsave(append, name="logseriessource", type=text) {%chartcodeloc}
''''''''
logclear(name="logseriessource")
Has anybody else had issues while saving the log?
I'm generating a string with all the series that i want to log, then log each series individually in the logmsg. generate the location of where the text file will be saved, then saving it.
Here is the code:
string serieslist=@wlookup("*xr*", "series")
group currencymaster {serieslist}
string path=@runpath
string name = @runname
string path=path+name
for %var {serieslist}
%command=%var + ": " + path
logmsg {%command}
next
%datenow = @strnow("yyyy/mm/dd")
%datenow=@replace(%datenow,"/","-")
%chartcodeloc="c:\somelocation\log\log_" + %datenow + ".txt"
''''''''THIS IS WHERE IT FREEZES AND CRASHES
logsave(append, name="logseriessource", type=text) {%chartcodeloc}
''''''''
logclear(name="logseriessource")
Has anybody else had issues while saving the log?
-
- EViews Developer
- Posts: 563
- Joined: Thu Apr 25, 2013 7:48 pm
Re: get program name or path
I'm not aware of a workaround for @runpath and @runname's behavior, it's a limitation of the current internal representation of programs.
Re: get program name or path
Ok thanks. I found a way around it (had to write a subroutine tat executes the programs). How about the crashing issue? Have you seen anybody reporting bugs/crashing while using logsave?
-
- EViews Developer
- Posts: 563
- Joined: Thu Apr 25, 2013 7:48 pm
Re: get program name or path
They do crop up from time to time (top post in the Bug Report forum is a logsave bug at the moment). What version of EViews are you running and is there a logmode statement in your program?
Re: get program name or path
i have logmode(name="logseriessource", ts) logmsg at the top of every program that uses logmsg
I do get the crash every single time though. Even if i stop the program before the logsave, and run that part in the command
Eviews 10, August 22 2018 build.
I do get the crash every single time though. Even if i stop the program before the logsave, and run that part in the command
Eviews 10, August 22 2018 build.
Re: get program name or path
Ok so i think i’ve figured it out. The problem was my workaround involved making a subroutine that logged the low level program name and then it executed it. The problem seems to have been the execution inside the sub routine.
It’s very strange and i don’t know exactly why this was happening. But having the subroutine only log the low level program with executing it did the trick, for now.
It’s very strange and i don’t know exactly why this was happening. But having the subroutine only log the low level program with executing it did the trick, for now.
Who is online
Users browsing this forum: No registered users and 28 guests