Include more than once

For questions regarding programming in the EViews programming language.

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

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Include more than once

Postby paues » Fri Apr 13, 2012 2:22 am

The include command does not allow for a file to be included more than once. This is just wrong.

(I see that you might want to add some sort of limitation so that the program does not end up in an infinite loop, although I think also that should be up to the user. After all, you let infinite loops pass with e.g. the while command. But if you must include an infinite-loop limitation, then do it properly by going through each included file and check that such a loop does not occur.)

Also, it is very much possible to include a file more than once just by putting it in a for or while loop.

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

Re: Include more than once

Postby EViews Gareth » Fri Apr 13, 2012 6:52 am

I'm not sure I see the case for wanting to include a file more than once. Surely once the subroutines are defined, they're defined, and don't need to be re-defined.

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Re: Include more than once

Postby paues » Fri Apr 13, 2012 7:25 am

In my case there is no subroutine in the included file. It is just code. And I would like to include the code from that file more than once in another file. It is possible that I could rewrite the whole thing as a subroutine, but this is nevertheless an unneccessary restriction. I just cannot see any reason for why I should not be allowed to include a file more than once. (Ideally, EViews would not object until a file became too large to process.)

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

Re: Include more than once

Postby EViews Gareth » Fri Apr 13, 2012 8:08 am

I'm not sure I've ever used an include statement that wasn't there solely for use with subroutines. I'll take your objection under advisement though.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests