Page 1 of 1
Changing names of objects in a group
Posted: Thu May 23, 2024 2:54 pm
by neilblake
if a have a group g_base which contains X1_base X2_base X3_base etc, is there an easy way to create a group G_ALT from it which is comprised of X1_alt X2_alt X3_alt etc?
Re: Changing names of objects in a group
Posted: Thu May 23, 2024 3:02 pm
by EViews Gareth
Code: Select all
wfcreate u 100
for !i=1 to 3
series x{!i}_base
series x{!i}_alt
next
group g_base *base
group g_alt
%list = g_base.@members
for %j {%list}
%prefix = @left(%j, @instr(%j, "_"))
%new = %prefix + "alt"
g_alt.add {%new}
next
Re: Changing names of objects in a group
Posted: Thu May 23, 2024 4:13 pm
by neilblake
Could I use this to create a group where the member are just x1, X2, X3 etc rather than X1_alt, X2_alt, X3_alt etc?
Re: Changing names of objects in a group
Posted: Thu May 23, 2024 4:47 pm
by EViews Gareth
Yes, just change the %new line
Re: Changing names of objects in a group
Posted: Thu May 23, 2024 11:14 pm
by neilblake
change it to what?