Overwriting graph file?

For questions regarding programming in the EViews programming language.

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

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Overwriting graph file?

Postby paues » Tue Oct 30, 2012 9:17 am

Is there some option to the graph type command .save that ensures that graph files are overwritten? I would like the code below to yield a graph where tmp=2 and not, as the code is written now, tmp=1. Also, it would be nice to be prompted that the file already exists.

Code: Select all

close @all wfcreate a 1900 1905 series tmp=1 graph test.line tmp test.save(t=png,u=pixels,w=600,h=400,c) c:\temp\test series tmp=2 test.save(t=png,u=pixels,w=600,h=400,c,o) c:\temp\test

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

Re: Overwriting graph file?

Postby EViews Gareth » Tue Oct 30, 2012 1:11 pm

I'm not sure I follow. Your program only creates one graph object, then saves that graph object twice. Since the graph object has not changed, the file on disk does not change.

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Re: Overwriting graph file?

Postby paues » Wed Oct 31, 2012 1:34 am

As the graphed series tmp change, the graph containing that series also changes. However, the saved file does not change.

But flawed or not, my code was just an example. The question remains: can I make the save command overwrite an existing file?

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

Re: Overwriting graph file?

Postby EViews Gareth » Wed Oct 31, 2012 7:56 am

Well, my point was that that is exactly what the save command does. In fact, I don't believe there is a way to stop it from overwriting the file on disk.

Take this example:

Code: Select all

create u 100 series y=3 freeze(g1) y.line series x=6 freeze(g2) x.line g1.save(t=png,u=pixels,w=600,h=400,c) c:\temp\test g2.save(t=png,u=pixels,w=600,h=400,c) c:\temp\test
You'll notice that the resultant file is a graph of X, not Y.

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Re: Overwriting graph file?

Postby paues » Wed Oct 31, 2012 8:12 am

Thank you for straightening that out.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest