Problem with include in if-statement

For notifying us of what you believe are bugs or errors in EViews.
Please ensure your copy of EViews is up-to-date before posting.

Moderators: EViews Gareth, EViews Moderator

pelleenglund
Posts: 7
Joined: Fri Sep 16, 2016 6:35 am

Problem with include in if-statement

Postby pelleenglund » Thu Nov 17, 2016 5:07 am

Hello!

I sometimes use "Include" to include another EViews-program in a main EViews-program. It works just fine except when you use it in an if-statement, for example like this

If ..... Then
Include "C:\Temp\Example.prg"
EndIf

Then you get the error message "Endif found outside of loop or IF statement". The code will run without error if you include it without putting it in the if-statement, and it works fine if you change "Include" to "Run" or "Exec" instead.

I just wonder if this may be a bug?

Best regards,
Pelle

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

Re: Problem with include in if-statement

Postby EViews Gareth » Thu Nov 17, 2016 5:17 am

Probably just the way you have the included program written.

It is easy to show that in general it works ok:

myfile.prg:

Code: Select all

series a = @nrnd


parent program:

Code: Select all

create m 1990 2000
if 3>2 then
include myfile.prg
endif
Follow us on Twitter @IHSEViews

pelleenglund
Posts: 7
Joined: Fri Sep 16, 2016 6:35 am

Re: Problem with include in if-statement

Postby pelleenglund » Thu Nov 17, 2016 6:20 am

Well, I have tried to write the code in different ways (for example with and without "" around the program that should be included) but it doesn't work. Thanks anyway, and it is okey since I can always use "Run" instead.

Best regards,
Pelle


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 2 guests