Page 1 of 1

a program executing other program in a loop (EV 6)

Posted: Mon Jul 26, 2010 1:09 am
by Krzysztof
Hi,
I would like to ask the following question.
Would it be possible to write a program which would run other program in a loop with different arguments depending on a step of the loop. I have one prg with a parameter and I can execute it from a command line for instance: run program_1 austria, run program_1 belgium, etc. where argument in this case is a country name.
Many thanks in advance.

Re: a program executing other program in a loop (EV 6)

Posted: Mon Jul 26, 2010 10:11 am
by EViews Glenn
In EViews 6, a running program file ends all program execution upon return. So you cannot run a program from within a program and return control to the calling program upon completion. You can use include statements to get the same effect, as described in the manual.

One of the major advances in EViews 7 is to allow the return of control to the original program.

Re: a program executing other program in a loop (EV 6)

Posted: Wed Aug 04, 2010 2:31 am
by Krzysztof
Hi,
luckily I can use Eviews 7 now.
Would you tell me how to overcome this problem in Eviews 7?
To be more precise I would like to execute the piece of program below. However, the execution stops after first step so I guess I need some command to return control to the calling program.
Many thanks is advance.

Code: Select all

for %aCtry country1 country2 country3 country4 run my_program {%aCtry} next

Re: a program executing other program in a loop (EV 6)

Posted: Wed Aug 04, 2010 8:09 am
by EViews Gareth
Use the EXEC command rather than the RUN command.

The main difference between the two is that the EXEC returns to the calling program upon exit, whereas RUN stops.

Re: a program executing other program in a loop (EV 6)

Posted: Thu Aug 05, 2010 2:08 am
by Krzysztof
Thanks but are you sure about that (see the attachment)? I was not able to find this command in the Eviews manuals either.

Re: a program executing other program in a loop (EV 6)

Posted: Thu Aug 05, 2010 6:30 am
by EViews Gareth
You need to make sure you're using EViews 7.1