establishing a link in a loop

For questions regarding programming in the EViews programming language.

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

faustocoppi
Posts: 2
Joined: Tue Sep 08, 2009 5:05 am

establishing a link in a loop

Postby faustocoppi » Wed Sep 09, 2009 1:25 am

Hi,

in a frequency conversion (monthly - quarterly) I want to do a link in a for next loop for some variables that i have grouped, but i cant make it work.
I find the loop better than making a link for each variable seperatly but i get a syntax error: Syntax error in "FOR !I=1 TO GRP_AA.@COUNT


here is the code:


wfcreate(page=mensuel) m 1995:1 2009:6

group grp_aa IPCN05 IPCNHPETR05 IPCNPETR05 IPCNSJ05 IPCNALIM05 IPCNALCTAB05 IPCNHAB05 IPCNLOGE05 IPCNMEUB05 IPCNSANT05 IPCNTRANS05 IPCNCOMM05 IPCNLOIS05 IPCNENSG05 IPCNHORECA05 IPCNAUTR05 IPCHLU05 IPCHDE05 IPCHFR05 IPCHBE05 IPCHNL05 IPCH4MOY05 IPCHZE05 IPCH27UE96 IPCUSA IPCJP IPCN_A1 IPCN48MOYSEM IPCN48SEUCLIQ EMS P_PETUS P_PETEUR IPCNHSOLD05 IPCNSJHSOLD05 IPCNCVS05 IPCNSJCVS05 IPCNSJBIEN05 IPCNSJSERV06 IPCNHNRJ05 IPCHSJ05


pagecreate(page=trimestriel) q 1995 2009

for !i=1 to grp_aa.@count
%1=grp_aa@seriesname(!i)
link {%1}.linkto mensuel::{%1}
next

end

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: establishing a link in a loop

Postby trubador » Wed Sep 09, 2009 3:16 am

You have several other problems in your code. I think you are trying to write something like this:

Code: Select all

'....... !n = grp_aa.count pagecreate(page=trimestriel) q 1995 2009 for !i=1 to !n pageselect mensuel %1=grp_aa.@seriesname(!i) pageselect trimestriel link {%1}.linkto(c=a) mensuel\{%1} next
You can achieve this also by a simple copy-and-paste special of the group between the pages...

faustocoppi
Posts: 2
Joined: Tue Sep 08, 2009 5:05 am

Re: establishing a link in a loop

Postby faustocoppi » Wed Sep 09, 2009 4:57 am

got it!

thanks a million for your help!!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests