Page 1 of 1

include command clarification

Posted: Fri Sep 16, 2016 8:33 am
by bco
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.

Re: include command clarification

Posted: Fri Sep 16, 2016 8:38 am
by EViews Gareth
In general, no, not with an Include. You cannot dynamically change the name/path of an included file.

Re: include command clarification

Posted: Fri Sep 16, 2016 8:57 am
by bco
Can it be done with a run or exec command? And how - an example will help ...

Re: include command clarification

Posted: Fri Sep 16, 2016 9:27 am
by EViews Gareth

Code: Select all

For %file file1 file2 exec %file next

Re: include command clarification

Posted: Fri Sep 16, 2016 9:35 am
by bco
And if the files (to be run) are in different folders/subfolders it will still work?

Re: include command clarification

Posted: Fri Sep 16, 2016 9:36 am
by EViews Gareth

Code: Select all

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