Referencing objects in workfile EV6

For questions regarding programming in the EViews programming language.

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

Tomski
Posts: 4
Joined: Thu Jun 10, 2010 1:57 am

Referencing objects in workfile EV6

Postby Tomski » Thu Jun 10, 2010 2:18 am

Hi,

Is it possible to reference objects in a workfile without knowing their name. So for example, say I open foreign data as a workfile, I then have a workfile that contains a number of series, can I apply the dlog operator to each series? I imagine it would be something along the lines of:

series dl1 = dlog(series_in_wf_array(1))

series dl2 = dlog(series_in_wf_array(2))

etc...

Or set a string variable to the first series name, so somnething like

%series1 = series_in_wf_array(1).name

Thanks,

Tom

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13600
Joined: Tue Sep 16, 2008 5:38 pm

Referencing objects in workfile EV6

Postby EViews Gareth » Thu Jun 10, 2010 6:57 am

You can use the @wlookup function to obtain the names of the objects in the workfile.

Tomski
Posts: 4
Joined: Thu Jun 10, 2010 1:57 am

Re: Referencing objects in workfile EV6

Postby Tomski » Thu Jun 10, 2010 8:07 am

Thanks, but I'm using eviews 6 which doesn't seem to have that method.

I'm basically trying to loop through a number series and create new dlog series for each one. Struggling a little with the syntax.

T

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13600
Joined: Tue Sep 16, 2008 5:38 pm

Re: Referencing objects in workfile EV6

Postby EViews Gareth » Thu Jun 10, 2010 8:18 am

Sorry, didn't notice you were using EV6 (my fault!).

If you're only interested in series, you can create a group with all series in the workfile, then loop through the members of the loop one at a time:

Code: Select all

group g * for !i=1 to g.@count %sn = g.@seriesname(!i) 'do something here next

Tomski
Posts: 4
Joined: Thu Jun 10, 2010 1:57 am

Re: Referencing objects in workfile EV6

Postby Tomski » Thu Jun 10, 2010 11:14 pm

Great, thanks

T


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests