how to run multiple program in one program?

For questions regarding programming in the EViews programming language.

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

cc100
Posts: 62
Joined: Wed Jul 22, 2015 1:58 pm

Re: how to run multiple program in one program?

Postby cc100 » Mon Dec 14, 2015 3:21 am

Hi Gareth,

Sorry I still can't get it to work.... I have read the documentation you sent and am writing the following:

The child program begins with the following line:
wfcreate {%filename1} d5 {%my_startdate_usd} {%my_enddate}

The master program has the following:
%my_startdate_usd = "31/07/2000"
%my_enddate= "11/12/2015"
%filename1= "C:\documents\test1\usd_" + %str +".wf1"

exec "C\documents\test1\usd_rw.prg" %filename1 %my_startdate_usd %my_enddate
wfsave %filename1
wfclose %filename1

It works with the run command but not exec…(in fact it worked before with the run command, which makes me think I am not actually doing anything different!). Please can you tell me what is wrong with the above, apologies I know I am asking you the same thing multiple times...I don't understand why the above doesn't constitute 'passing arguments'.

cc100
Posts: 62
Joined: Wed Jul 22, 2015 1:58 pm

Re: how to run multiple program in one program?

Postby cc100 » Mon Dec 14, 2015 5:07 am

Hi Gareth, I have noticed it works if I use %0, %1 and %2 instead of %filename1, %my_startdate_usd and %my_enddate. But I note that if I do not use consecutive numbers, or if I use double digit numbers then if fails. Which will cause lots of problems for me as I want to run many child programs each of which have different start dates, but take the same end date and different filenames, so the argument number names won't always be consecutive and there will be more than 10.

Is this issue about the names I have chosen for my arguments? And if so how can I solve this above issue?

Thanks!

cc100
Posts: 62
Joined: Wed Jul 22, 2015 1:58 pm

Re: how to run multiple program in one program?

Postby cc100 » Tue Dec 15, 2015 1:04 am

Hi Can someone check the above post please - I would really appreciate it.

cc100
Posts: 62
Joined: Wed Jul 22, 2015 1:58 pm

Re: how to run multiple program in one program?

Postby cc100 » Tue Dec 15, 2015 6:08 am

I am restating the problem, in the hope of getting an answer!

If i run the following master and child programs it works:

Master program:
%0 = "P:\documents\test1\usd.wf1"
%1 = "31/07/2000"
%2 = "15/12/2015"

exec "P:\documents\test1\testing.prg" {%0} {%1} {%2}
wfsave {%0}
wfclose {%0}


Child program:
wfcreate {%0} d5 {%1} {%2}


If however I run the following master and child programs it fails:

Master program:
%filename1 = "P:\documents\test1\usd.wf1"
%my_startdate_usd = "31/07/2000"
%my_enddate = "15/12/2015"

exec "P:\documents\test1\testing.prg" {%filename1} {%my_startdate_usd} {%my_enddate}
wfsave {%filename1}
wfclose {%filename1}

Child:
wfcreate {%filename1} d5 {%my_startdate_usd} {%my_enddate}


Please could you tell me why it fails in the second case?

Thanks

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

Re: how to run multiple program in one program?

Postby EViews Gareth » Tue Dec 15, 2015 9:52 am

You need to use %0, %1 etc.. in your child programs. You don't need to use them in the parent.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests