Mac user here, but I am using Eviews through Parallels Desktop. One issue that I encounter frequently is a changing drive. For example
fetch(d="x:\<path-to-a -database\somedatabase.edb") {%CONCEPTS}
Will work sometimes, but randomly “x” will change to the “w” drive (or even sometimes "y") and I don’t know why that is. So I’m forced to just hard code it to
fetch(d="w:\<path-to-a -database\somedatabase.edb") {%CONCEPTS}
The behavior is quite inconsistent. Is it possible to execute some form a try and except?
Something along the lines of
try:
fetch(d="x:\<path-to-a -database\somedatabase.edb") {%CONCEPTS}
except:
fetch(d="w:\<path-to-a -database\somedatabase.edb") {%CONCEPTS}
Is there a way to do this in EViews?
Try and Except in EViews
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
- EViews Developer
- Posts: 569
- Joined: Thu Apr 25, 2013 7:48 pm
Re: Try and Except in EViews
Hello,
EViews doesn't provide exception-style error handling, but a program can detect that an error has occurred and react rather than simply stopping. For example:
The basic idea is to increase the allowed error limit before EViews halts the program, run the statement that may generate an error, detect whether an error occurred, and then react if necessary.
EViews doesn't provide exception-style error handling, but a program can detect that an error has occurred and react rather than simply stopping. For example:
Code: Select all
setmaxerrs 2
fetch(d="x:\<path-to-a -database\somedatabase.edb") {%CONCEPTS}
!error_occurred = @errorcount > 0
clearerrs
setmaxerrs 1
if !error_occurred then
fetch(d="w:\<path-to-a -database\somedatabase.edb") {%CONCEPTS}
endif
Re: Try and Except in EViews
Thanks for the response, Matt! I will try to fold this in.
Who is online
Users browsing this forum: Baidu [Spider], Bing [Bot] and 0 guests