Page 1 of 1

establishing a link in a loop

Posted: Wed Sep 09, 2009 1:25 am
by faustocoppi
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

Re: establishing a link in a loop

Posted: Wed Sep 09, 2009 3:16 am
by trubador
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...

Re: establishing a link in a loop

Posted: Wed Sep 09, 2009 4:57 am
by faustocoppi
got it!

thanks a million for your help!!