error if I change the order of block lines

For questions regarding programming in the EViews programming language.

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

maxchen
Posts: 191
Joined: Fri Oct 10, 2008 4:03 pm

error if I change the order of block lines

Postby maxchen » Wed Dec 22, 2010 4:57 am

EV7.1, b2010-12-02

Code: Select all

%ex7 = "\Example Files\EV7 Manual Data\" %ch26 = "Chapter 26 - Discrete and Limited Dependent Variable Models" %wf = @evpath + %ex7 +%ch26 +"\censor.wf1" wfopen %wf equation eq20.censored(t,d=x) hrs c age edu kid1 eq20.fit yf eq20.fit(i) qi eq20.forecast y2 'compute index eq20.makeregs xx series h = eq20.c(1) for !i = 2 to xx.@count h = h+eq20.c(!i)*xx(!i) next eq20.makemodel(mod1) mod1.solve(g=n,z=n) c = 100 c(1) = @sum(@abs(qi-h)) c(2) = @sum(@abs(qi-i_hrs_0)) c(3) = @sum(@abs(yf-hrs_0)) c(4) = @sum(@abs(y2-yf))
The error will be "I_hrs_0 is not defined in ....."

However, if I change the block sequence as

Code: Select all

%ex7 = "\Example Files\EV7 Manual Data\" %ch26 = "Chapter 26 - Discrete and Limited Dependent Variable Models" %wf = @evpath + %ex7 +%ch26 +"\censor.wf1" wfopen %wf equation eq20.censored(t,d=x) hrs c age edu kid1 'compute index eq20.makeregs xx series h = eq20.c(1) for !i = 2 to xx.@count h = h+eq20.c(!i)*xx(!i) next eq20.fit yf eq20.fit(i) qi eq20.forecast y2 eq20.makemodel(mod1) mod1.solve(g=n,z=n) c = 100 c(1) = @sum(@abs(qi-h)) c(2) = @sum(@abs(qi-i_hrs_0)) c(3) = @sum(@abs(yf-hrs_0)) c(4) = @sum(@abs(y2-yf))
will produce error: "Syntax error in DO_ eq20.fit(i) qi"
the differences are that the computation of h is move to lines before "fit" (the order is h - qi - mod1)
and the following code works (the order is qi - mod1 - h)

Code: Select all

%ex7 = "\Example Files\EV7 Manual Data\" %ch26 = "Chapter 26 - Discrete and Limited Dependent Variable Models" %wf = @evpath + %ex7 +%ch26 +"\censor.wf1" wfopen %wf equation eq20.censored(t,d=x) hrs c age edu kid1 eq20.fit yf eq20.fit(i) qi eq20.forecast y2 eq20.makemodel(mod1) 'mod1.unlink @all mod1.solve(g=n,z=n) 'stop 'compute index eq20.makeregs xx series h = eq20.c(1) for !i = 2 to xx.@count h = h+eq20.c(!i)*xx(!i) next c = 100 c(1) = @sum(@abs(qi-h)) c(2) = @sum(@abs(qi-i_hrs_0)) c(3) = @sum(@abs(yf-hrs_0)) c(4) = @sum(@abs(y2-yf))
I am puzzled, is it possible some hiden bugs?

maxchen
Posts: 191
Joined: Fri Oct 10, 2008 4:03 pm

Re: error if I change the order of block lines

Postby maxchen » Thu Aug 18, 2011 8:01 pm

the same problem in EViews7Patch_081811.exe


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests