Page 1 of 1
What does w{%A}(!i+1) mean in EViews?
Posted: Thu Dec 03, 2015 10:31 pm
by windtalker
Hi guys,
I am new to EViews and need understand a snippet code.
Say I have a for loop like
Code: Select all
For %Y 1 2 3 4 5 6 7 8 9
For !i=10 to 20
If w{%Y}(!i+1) <> na then
...
NEXT
NEXT
What does w{%A}(!i+1) mean? Honestly I tried to figure this out myself but I at least spent 3 hrs but could understand this. I know maybe w{%A}(!i+1) is not correct, if so what does w{%A} mean?
Thanks!
Re: What does w{%A}(!i+1) mean in EViews?
Posted: Thu Dec 03, 2015 11:17 pm
by EViews Gareth
Impossible to say without knowing what the W objects are.
w{%y} just means that the loop will first run on w1, then w2, and so on.
Re: What does w{%A}(!i+1) mean in EViews?
Posted: Thu Dec 03, 2015 11:23 pm
by windtalker
Impossible to say without knowing what the W objects are.
w{%y} just means that the loop will first run on w1, then w2, and so on.
There is no definition for 'w' before that, but w{%y} appears couple of times in the code.
And, is w{%A}(!i+1) a legal expression? If yes, what is it?
Thank you!
Re: What does w{%A}(!i+1) mean in EViews?
Posted: Thu Dec 03, 2015 11:45 pm
by EViews Gareth
Yes it is a legal expression. Without knowing what the objects in the workfile are, it is impossible to say what the expression does though.
Re: What does w{%A}(!i+1) mean in EViews?
Posted: Fri Dec 04, 2015 9:28 am
by windtalker
Yes it is a legal expression. Without knowing what the objects in the workfile are, it is impossible to say what the expression does though.
Seems I need to figure out the purples first.
So based on that what should I do if I want to print output to screen?
Say
for !i=1 to 5
...
next
How to print each !i to screen?
Thank you!
Re: What does w{%A}(!i+1) mean in EViews?
Posted: Fri Dec 04, 2015 9:35 am
by EViews Gareth
You could use a
statusline command to send the value of !i to the statusline.
Or use a
log message.
Re: What does w{%A}(!i+1) mean in EViews?
Posted: Fri Dec 04, 2015 9:48 am
by EViews Glenn
This may be easier than you think as I'm not sure that you understood Gareth's last answer.
The snippet that you run will do something, where that something will depend on what kind of objects W1, W1, etc. are in the active workfile when you run the code.
So if you have the workfile that is associated with these commands, you can simply look at the icon and determine what type of object you have. From the looks of it, I'd say a probably a vector. But you need to know the context of the program. My guess is that it's just doing something if elements of the vectors W1, W2 are non-missing.
Re: What does w{%A}(!i+1) mean in EViews?
Posted: Fri Dec 04, 2015 10:07 am
by windtalker
That runs too fast on statusline which I could not read each value, but not a big issue.
Thank you again.
So can you point any reference about {}()? It's hard to find the use of it without a key word. At this moment w is unknown but I may find it if I have reference of it and the code purpose.
Re: What does w{%A}(!i+1) mean in EViews?
Posted: Fri Dec 04, 2015 10:09 am
by EViews Gareth
The () operators change depending on what type of object they are used on.
http://www.eviews.com/help/helpintro.ht ... 04.html%23
Re: What does w{%A}(!i+1) mean in EViews?
Posted: Fri Dec 04, 2015 3:14 pm
by windtalker
Hi...I am using EViews 9
below is my snippet to use logmsg and logsave
Code: Select all
For !i=0 to 9
logmsg !i
Next
logmsg "Mark"
logsave E:\\test.txt
No bug reported after I clicked "Run" however the test.txt file in E drive was empty.
How can I write out output to screen or to log file...
Re: What does w{%A}(!i+1) mean in EViews?
Posted: Fri Dec 04, 2015 3:49 pm
by EViews Gareth
Re: What does w{%A}(!i+1) mean in EViews?
Posted: Fri Dec 04, 2015 3:52 pm
by windtalker
Thanks a lot!
have a great weekend!