Error Handling

For questions regarding programming in the EViews programming language.

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

tim_r
Posts: 4
Joined: Tue Jan 12, 2021 8:29 pm

Error Handling

Postby tim_r » Sun Jan 31, 2021 6:43 pm

Hi

I am doing a grid search using a for loop. In each iteration I estimate an equation. For some iterations the estimation does not work. How can I tell EViews to exit the loop when the error occurs, rather than the program stopping?

I am using EViews 12.

Thanks
Tim

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

Re: Error Handling

Postby EViews Gareth » Sun Jan 31, 2021 10:51 pm

Look up setmaxerrs and @errorcount

tim_r
Posts: 4
Joined: Tue Jan 12, 2021 8:29 pm

Re: Error Handling

Postby tim_r » Mon Feb 01, 2021 2:45 am

Hi Gareth

Thanks. I would prefer to get the program to exit the loop, as if estimation fails once it must fail for all of the subsequent iterations, and they don't need to be tried as would happen with those commands. Is that possible?

tim

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

Re: Error Handling

Postby EViews Gareth » Mon Feb 01, 2021 7:16 am

Exitloop is the command to exit a loop


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest