Page 1 of 1

use control variable when naming a string variable

Posted: Thu Sep 10, 2009 10:13 am
by cap
Hello,

I would like to have a for loop where my control variable is used in the name of strings that I define. The documentation mentions how to do this when naming series, but not when defining names for strings.


I have tried the following, but get errors:

for !i = 1 to 3

%stringname_!i = @right(mygroup.@seriesname(!i+1),6)
alpha string_!i = @insert(%stringname_!i,"xyz",2)

next



Thanks in advance,
-cap

Re: use control variable when naming a string variable

Posted: Thu Sep 10, 2009 10:28 am
by EViews Gareth
I don't think that is currently possible. You cannot dynamically assign the name of a program variable.

You could try storing the strings as cells in a table rather than in string variables though.

Code: Select all

table a for !i=1 to 3 a(1,!i) = @right(mygroup.@seriesname(!i+1),6) %stringname = a(1,!i) alpha string_!i = @insert(%stringname,"xyz",2)