I found a little bug in the commands "include" and "exec".
Below are two codes named "testa1" and "testa2" repectively:
The first one "testa1" is:
Code: Select all
%freq = "q"
exec .\testa2
'include testa2
The second one "testa2" is:
Code: Select all
if %freq = "q" then
wfcreate(wf=evp, page=simcast) {%freq} 1970q1 2050q4
else
wfcreate(wf=evp, page=simcast) {%freq} 1970m01 2050m04
endif
When I use the "exec" command to execute the testa2.prg, EViews cannot work and tells me the sentence of "wfcreate(wf=evp)..." is incomplete. I believe it means the "%freq" I declared in the testa1.prg cannot transmit into the testa2.prg.
When I use the "include" command to execute the testa2.prg, EViews works perfectly. However, based on the programming instruction about the "include", the "%freq" I declared in the testa1.prg should not transmit into the testa2.prg.
I would like to ask why?
If I want to transmit a program variable in the parent program to the child program, which command should I use?
Thanks!