Putting the data in a workfile create line of code

For questions regarding programming in the EViews programming language.

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

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Putting the data in a workfile create line of code

Postby miorinnovo » Wed Mar 15, 2017 8:43 am

Hi

I have a program that runs creates a workfile, and I would like to be able to just save everything I do everyday and start fresh the next day. Is there a way to name the workfile using today's date automatically (i.e. without the save as and typing in the date)?

Thanks!

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

Re: Putting the data in a workfile create line of code

Postby EViews Gareth » Wed Mar 15, 2017 8:52 am

Code: Select all

%filename = "workfile_" + @strnow("YYYY-MM-DD") wfsave %filename

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Putting the data in a workfile create line of code

Postby miorinnovo » Wed Mar 15, 2017 9:03 am

Thanks!

Here's a follow up. I had it saving to a specific location before, but it doesn't do that anymore. Do you know how to make that tweak so it saves in a location of my choosing?


I was using:

Code: Select all

create(page=annual) r:\\Eviewsfiles\Eviews a 1981 2018

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

Re: Putting the data in a workfile create line of code

Postby EViews Gareth » Wed Mar 15, 2017 9:08 am

Code: Select all

%filename = "r:\EViewsfiles\EViews\workfile_" + @strnow("YYYY-MM-DD") wfsave %filename

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Putting the data in a workfile create line of code

Postby miorinnovo » Wed Mar 15, 2017 9:13 am

That's awesome, thanks again.

By the way, is there a way to get a similar type of automated naming from the prg file when I save it?

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

Re: Putting the data in a workfile create line of code

Postby EViews Gareth » Wed Mar 15, 2017 9:49 am

No.

miorinnovo
Posts: 199
Joined: Sun Mar 01, 2015 5:01 pm

Re: Putting the data in a workfile create line of code

Postby miorinnovo » Wed Mar 15, 2017 9:54 am

Ok thanks gareth.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests