What does w{%A}(!i+1) mean in EViews?

For questions regarding programming in the EViews programming language.

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

windtalker
Posts: 6
Joined: Thu Dec 03, 2015 10:17 pm

What does w{%A}(!i+1) mean in EViews?

Postby windtalker » Thu Dec 03, 2015 10:31 pm

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!

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

Re: What does w{%A}(!i+1) mean in EViews?

Postby EViews Gareth » Thu Dec 03, 2015 11:17 pm

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.

windtalker
Posts: 6
Joined: Thu Dec 03, 2015 10:17 pm

Re: What does w{%A}(!i+1) mean in EViews?

Postby windtalker » Thu Dec 03, 2015 11:23 pm

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!

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

Re: What does w{%A}(!i+1) mean in EViews?

Postby EViews Gareth » Thu Dec 03, 2015 11:45 pm

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.

windtalker
Posts: 6
Joined: Thu Dec 03, 2015 10:17 pm

Re: What does w{%A}(!i+1) mean in EViews?

Postby windtalker » Fri Dec 04, 2015 9:28 am

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!

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

Re: What does w{%A}(!i+1) mean in EViews?

Postby EViews Gareth » Fri Dec 04, 2015 9:35 am

You could use a statusline command to send the value of !i to the statusline.

Or use a log message.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: What does w{%A}(!i+1) mean in EViews?

Postby EViews Glenn » Fri Dec 04, 2015 9:48 am

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.

windtalker
Posts: 6
Joined: Thu Dec 03, 2015 10:17 pm

Re: What does w{%A}(!i+1) mean in EViews?

Postby windtalker » Fri Dec 04, 2015 10:07 am

You could use a statusline command to send the value of !i to the statusline.

Or use a log message.
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.

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

Re: What does w{%A}(!i+1) mean in EViews?

Postby EViews Gareth » Fri Dec 04, 2015 10:09 am

The () operators change depending on what type of object they are used on.

http://www.eviews.com/help/helpintro.ht ... 04.html%23

windtalker
Posts: 6
Joined: Thu Dec 03, 2015 10:17 pm

Re: What does w{%A}(!i+1) mean in EViews?

Postby windtalker » Fri Dec 04, 2015 3:14 pm

The () operators change depending on what type of object they are used on.

http://www.eviews.com/help/helpintro.ht ... 04.html%23

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...

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

Re: What does w{%A}(!i+1) mean in EViews?

Postby EViews Gareth » Fri Dec 04, 2015 3:49 pm


windtalker
Posts: 6
Joined: Thu Dec 03, 2015 10:17 pm

Re: What does w{%A}(!i+1) mean in EViews?

Postby windtalker » Fri Dec 04, 2015 3:52 pm

Thanks a lot!
have a great weekend!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests