include command clarification

For questions regarding programming in the EViews programming language.

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

bco
Posts: 5
Joined: Wed Jun 01, 2016 3:55 am

include command clarification

Postby bco » Fri Sep 16, 2016 8:33 am

I want to know if I can run/execute (with the include command) a number of subprograms (that are in different folders) in a FOR loop depending on a parameter. For the moment only the first program is run and then the whole thing stops.
THX.
Last edited by bco on Fri Sep 16, 2016 8:57 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 command clarification

Postby EViews Gareth » Fri Sep 16, 2016 8:38 am

In general, no, not with an Include. You cannot dynamically change the name/path of an included file.

bco
Posts: 5
Joined: Wed Jun 01, 2016 3:55 am

Re: include command clarification

Postby bco » Fri Sep 16, 2016 8:57 am

Can it be done with a run or exec command? And how - an example will help ...

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

Re: include command clarification

Postby EViews Gareth » Fri Sep 16, 2016 9:27 am

Code: Select all

For %file file1 file2 exec %file next

bco
Posts: 5
Joined: Wed Jun 01, 2016 3:55 am

Re: include command clarification

Postby bco » Fri Sep 16, 2016 9:35 am

And if the files (to be run) are in different folders/subfolders it will still work?

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

Re: include command clarification

Postby EViews Gareth » Fri Sep 16, 2016 9:36 am

Code: Select all

for %fileandpath "c:\temp\folder 1\file1" "c:\temp\folder 2\file2" exec %fileandpath next


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests