Include statement

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 statement

Postby paues » Fri Feb 03, 2012 8:15 am

From other posts and the somewhat mysterious behavior that the code below does not show a dialog box before returning an error I have understood that the include statement is processed before anything else in the code. This seems rather counter-intuitive (and is not mentioned in the command reference). Why is this? Are there any plans to change it?

Code: Select all

%tmp="C:\qwerty\uioup.prg" @uiprompt("hello world") include {%tmp}

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

Re: Include statement

Postby EViews Gareth » Fri Feb 03, 2012 8:40 am

No plans to change it. Use Exec instead.

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

Re: Include statement

Postby paues » Thu Mar 08, 2012 5:44 am

The problem I have with using the Exec command is that string variables assigned in the child are not passed back to the parent post execution of the child. This leaves the coder with the hassle of handling string objects.

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

Re: Include statement

Postby paues » Wed Dec 05, 2012 9:47 am

Are there still no plans to change this behavior?

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

Re: Include statement

Postby EViews Gareth » Wed Dec 05, 2012 10:04 am

Correct, no plans to change it.

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

Re: Include statement

Postby paues » Wed Dec 05, 2012 10:09 am

In that case, is it simply because the behavior would be difficult to change? Or is it because you think that it would be a bad idea to change it?
Last edited by paues on Wed Dec 05, 2012 10:21 am, edited 1 time in total.

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

Re: Include statement

Postby EViews Gareth » Wed Dec 05, 2012 10:18 am

Both.

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

Re: Include statement

Postby paues » Thu Dec 06, 2012 2:29 pm

I was hoping for a more thorough explanation :-) I don't have any trouble seeing that it might be difficult for you to change it, but I can't see why it would be a bad idea. The change I am suggesting would be perfectly backward-compatible, in that all previously written code would work just fine, while giving struggling EViews programmers, such as myself, more options.

Furthermore, the current behavior violates the belief, held by me and probably most of your users, that programs are read from the beginning to the end. Are there any other instances where EViews departs from that?

(If you do not plan to change it, at the very least, it should be mentioned in documentation.)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests