Output variable to file

For questions regarding programming in the EViews programming language.

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

Patrick
Posts: 5
Joined: Wed Oct 10, 2012 1:43 am

Output variable to file

Postby Patrick » Wed Oct 10, 2012 1:52 am

Hi, I have a simple regression that I output to a text file via

Code: Select all

... output(t) filename.txt equation eq.stepls() portfolio c @ somegroup eq.stats(p)
I also have a string variable %sometext that I would like to print to the text file somewhere. Anywhere is fine. How do I do this?

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

Re: Output variable to file

Postby EViews Gareth » Wed Oct 10, 2012 7:46 am

Code: Select all

string temp = %sometext print temp

Patrick
Posts: 5
Joined: Wed Oct 10, 2012 1:43 am

Re: Output variable to file

Postby Patrick » Thu Oct 11, 2012 1:32 am

Thanks Gareth, i tried to do print %day but declaring a string was the solution.

What's the difference between these?

Code: Select all

%test = "Hello" string test = "Hello"

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

Re: Output variable to file

Postby EViews Gareth » Thu Oct 11, 2012 6:18 am

One makes a program variable, that exists only whilst the program is running, the other makes a workfile object.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests