简体   繁体   中英

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

Couldn't find any hint about w{} on eviews documents. Any explanation?

w{}(), can't understand how it works.

BTW, how can I print a single variable to command window not print it to a file?

Thanks!

Curly braces in EViews work the way that statements like eval() perform in other programming languages. They tell EViews "strip quotes off of this string and evaluate it as valid EViews code".

%A is a "program string", a temporary string variable only used when executing an EViews program. !i is a "program scalar", a temporary scalar variable only used when executing an EViews program.

It's hard to answer your question without knowing what type of object W{%A} is supposed to be. But if %A holds a value like USA , for example, W{%A} will look for an object in your workfile called WUSA . If !i holds the value 1 , for example, W{%A}(!i+1) is equivalent to WUSA(2) . This could, for example, be an attempt to grab a particular element of a vector object.

{} can change a variables value (in programming not series) to string. For example if there is WTR, WCR, KJ and Y series in our file, following command would be run.

%A = "TR"
!i=2
ls Y c W{%A}(!i+1)

Means ls Y c WTR(3) and also

%A = "TR"
%B= "CR"
%F="KJ"
!i=3
!k=-1
 ls Y c W{%A}(!i+1) W{%B}(!k-3)  {%F} 

Means ls Y c WTR(4) WCR(-4) KJ

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM