Page 3 of 3

Re: how to run multiple program in one program?

Posted: Mon Dec 14, 2015 3:21 am
by cc100
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'.

Re: how to run multiple program in one program?

Posted: Mon Dec 14, 2015 5:07 am
by cc100
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!

Re: how to run multiple program in one program?

Posted: Tue Dec 15, 2015 1:04 am
by cc100
Hi Can someone check the above post please - I would really appreciate it.

Re: how to run multiple program in one program?

Posted: Tue Dec 15, 2015 6:08 am
by cc100
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

Re: how to run multiple program in one program?

Posted: Tue Dec 15, 2015 9:52 am
by EViews Gareth
You need to use %0, %1 etc.. in your child programs. You don't need to use them in the parent.