Annotated Lists

For questions regarding programming in the EViews programming language.

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

Posts: 1
Joined: Mon Oct 23, 2017 1:13 pm

Annotated Lists

Postby madm » Mon Feb 05, 2018 11:57 am


I am writing a program that assembles a list of variables that I use to extract series from an external source. As an example, suppose my code looks like this

Code: Select all

%vars = _
"GDP " + _
"CPI " + _

As I am adding to and removing from this list on a regular basis and the variable names are often unobvious, I was hoping to be able to annotate them with a comment:

Code: Select all

%vars = _
"GDP " + _   'Gross domestic product
"CPI " + _   'Consumer price index
"UNEMP"      'Unemployment

But it appears the Eviews parser can't handle this and it throws an error. I know I could probably set something up in a table, or I could just list everything again in a commented block, but neither of those ways is good from a maintainability perspective. Is there another way to do what I want to do programmatically? I guess one way would be to make the description part of the string and split it from the variables in the program. Not sure how I would do that.

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

Re: Annotated Lists

Postby EViews Gareth » Mon Feb 05, 2018 12:02 pm

Unfortunately EViews does not allow comments in the middle of a line, so you can't do it like that. I'd just go with a block before hand.
Follow us on Twitter @IHSEViews

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 11 guests