Eviews 7.1 - backwards compatibility, graph templates

For questions regarding programming in the EViews programming language.

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

cap
Posts: 55
Joined: Fri Oct 17, 2008 11:47 am

Eviews 7.1 - backwards compatibility, graph templates

Postby cap » Mon Sep 27, 2010 12:46 pm

Greetings,

I have a program I wrote in Eviews 6 which works fine. I have just installed Eviews 7.1, and now when I run the program it creates an error message.

The line of code in question tries to apply the template from one graph to another graph, like so:

figure_data_use.template(t) _figure_data_use

(yes the missing underscore is the only difference in file names of the two graphs, this is not a typo)

The error message I get says

_FIGURE_DATA_USE T is an illegal or reserved object name. Enter a name to be used in Eviews.

and it presents a dialog box for me to type in some other name, and a check box for "Add this name to the database alias list".

Could you please advise on why this line of code seems to not be acceptable now in version 7.1?

Thanks in advance,
-cap

EViews Pamela
EViews Developer
Posts: 54
Joined: Wed Sep 17, 2008 2:52 pm

Re: Eviews 7.1 - backwards compatibility, graph templates

Postby EViews Pamela » Mon Sep 27, 2010 4:05 pm

Do you have other objects (a database, etc.) named figure_data_use (with or without the leading underscore)?

cap
Posts: 55
Joined: Fri Oct 17, 2008 11:47 am

Re: Eviews 7.1 - backwards compatibility, graph templates

Postby cap » Tue Sep 28, 2010 2:27 pm

My workfile does have both graph objects existing before the code is run. The first figure gets deleted prior to when the above mentioned line of code is run, while the other figure remains untouched so that it can be used as a template source. This code has worked fine so far for years using version 6.


I have written some stand alone code that I think touches upon the problem. The syntax error I mentioned is not created here, but another problem I have which I didn't mention, is that my template is not applied correctly (or at least, not applied as it usually has been in version 6). My template involves having two series plotted using both a left and right vertical axis; my right axis does not get created now in version 7.1 and the graph looks very distorted.


The following code gives different results when run in version 6 and 7.1:


create u 100
series a = rnd
series b = rnd + 25

graph gr1.line a b
gr1.setelem(2) axis(right)
gr1.axis overlap


graph gr2.line a b
gr2.template(t) gr1


The graph gr2 looks different under each version, because I don't think version 7.1 carries out the very last line, where the template is applied.

Any ideas?

EViews Pamela
EViews Developer
Posts: 54
Joined: Wed Sep 17, 2008 2:52 pm

Re: Eviews 7.1 - backwards compatibility, graph templates

Postby EViews Pamela » Tue Sep 28, 2010 2:50 pm

You have touched upon one of the attributes within templates that are no longer applied. Scale assignments are not taken from the template graph. This was changed in an effort to make templates more useful for "appearance" customization (line color, etc.), while not changing fundamental graph characteristics, so that a template may be applied globally to a variety of data & graph types.

Understandably, this pleases some and disappoints others. You should use the setelem command as you did, but directly for gr2.

cap
Posts: 55
Joined: Fri Oct 17, 2008 11:47 am

Re: Eviews 7.1 - backwards compatibility, graph templates

Postby cap » Wed Oct 06, 2010 12:10 pm

I've written some more stand alone code that recreates the dialog box error I first mentioned, and I'm not sure what is causing it.


' Create a figure to be used as template source
create u 100
series a = rnd
series b = rnd + 25
group mydata a b

graph template_source.line a b
template_source.setelem(2) axis(right)
template_source.axis overlap

' Attempt to apply the template to a new graph
if @isobject("newgraph") then
delete newgraph
endif

graph newgraph mydata
newgraph.template(t) template_source ' apply template


As per the previous post, I understand the template itself will not be applied now in version 7.1. But aside from this, there is still the issue of why an error dialog box comes up and interrupts the program. I should state that in version 6 it does not; this code runs fine in version 6.

I believe the error stems from the very last line, in particular, the comment phrase on that line. If this comment phrase is erased or simply moved to another line, then the code runs fine and no error dialog is produced. Aren't comments allowed on the same line as code?


-cap

EViews Pamela
EViews Developer
Posts: 54
Joined: Wed Sep 17, 2008 2:52 pm

Re: Eviews 7.1 - backwards compatibility, graph templates

Postby EViews Pamela » Fri Oct 08, 2010 9:27 am

You were correct – the error was due to the comment following the template command.

The bug has been fixed and will be included in the next patch.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests