I have just started programming in Eviews 6 and I would like to know if there is a way of running only subsections of a code without using the stop command. Eg in Matlab and STATA I can highlight part of a code and run it using a shortcut.
Similarly how can I transform large section of a code in text without manually inputting the character <‘> in each line.
Thanks,
Marco
running only part of a programme
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
Re: running only part of a programme
You cannot run only part of a program (other than by putting an if condition around the other parts).
EViews 7 lets you block comment text, but EViews 6 does not have that functionality.
EViews 7 lets you block comment text, but EViews 6 does not have that functionality.
Re: running only part of a programme
If you are talking about running a few lines of code, you might as well just paste them into the command prompt. That is also a nice shortcut for those who (myself included) are comming from Matlab, VBA, etc.
Re: running only part of a programme
I'm in the same situation as the OP: just starting out in EViews 7 after many years of MATLAB.
I'm have been given some existing code and am working my way through it. Copying a few lines into a new program window has allowed me to run it in sections which was useful.
Now a few more questions:
1. Is it possible to display the values of string and control variables? I'd like to see the values of variables with names starting "%" or "!" so that I can confirm they are as expected.
2. I found the command "stop". Is it possible to restart code again after this?
3. Are there other useful debug commands that would allow me to step through code?
many thanks in advance
I'm have been given some existing code and am working my way through it. Copying a few lines into a new program window has allowed me to run it in sections which was useful.
Now a few more questions:
1. Is it possible to display the values of string and control variables? I'd like to see the values of variables with names starting "%" or "!" so that I can confirm they are as expected.
2. I found the command "stop". Is it possible to restart code again after this?
3. Are there other useful debug commands that would allow me to step through code?
many thanks in advance
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
Re: running only part of a programme
You can assign program variables to workfile variables (strings or scalars) to make them permanent, or you can use the statusline command to send them to the status bar.
EViews doesn't really have useful debug commands :(
EViews doesn't really have useful debug commands :(
Re: running only part of a programme
Gareth: many thanks for the prompt reply.
Both are helpful.
The statusline does the job for eyeballing the values.
Can I confirm that the easiest way to turn program variables to workfile variables is find & replace on "%" for "string " and "!" for "scalar "?
Or is there a smarter way?
thanks again
Both are helpful.
The statusline does the job for eyeballing the values.
Can I confirm that the easiest way to turn program variables to workfile variables is find & replace on "%" for "string " and "!" for "scalar "?
Or is there a smarter way?
thanks again
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
Re: running only part of a programme
You can't really do a find and replace on it.
With a program variable you would do something like this:
With a workfile object, you'd do it this way:
Note there is no object declaration in the program variable method, but there has to be in the workfile object method.
Also, using workfile objects rather than program variables isn't always better - for a start if you do anything that switches between workfile pages (or closes a workfile, opens one, etc...), you lose reference to the object. Secondly, re-running the program might be problematic if the workfile objects already exist. Thirdly, it can really clutter up your workfile.
When I'm debugging a program and want to keep track of my program variables, I'll often just create a table object in the workfile, and then, at the appropriate time, fill in a cell of the table with the value in the program variables.
With a program variable you would do something like this:
Code: Select all
!i = 10
'some stuff
!i=15
Code: Select all
scalar i = 10
'some stuff
i = 15
Also, using workfile objects rather than program variables isn't always better - for a start if you do anything that switches between workfile pages (or closes a workfile, opens one, etc...), you lose reference to the object. Secondly, re-running the program might be problematic if the workfile objects already exist. Thirdly, it can really clutter up your workfile.
When I'm debugging a program and want to keep track of my program variables, I'll often just create a table object in the workfile, and then, at the appropriate time, fill in a cell of the table with the value in the program variables.
Who is online
Users browsing this forum: No registered users and 2 guests
