Passing on program argument to a string var

For questions regarding programming in the EViews programming language.

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

renjinlu
Posts: 14
Joined: Tue Jan 06, 2009 8:34 pm

Passing on program argument to a string var

Postby renjinlu » Tue Jan 27, 2009 10:26 am

Hi, I have a simple question:

Suppose I want to pass on the value of a program argument to a string variable, how could I do that?

for Example

I am running a program called "diag" with an argument "CPI" (there are many other candidates, so I need to have a program variable). In the program, I want to make this explicit instead of keeping on using {%0}, so I have an extra line

%name={%0}

Hoping that I can pass on the string value of "CPI" to %name.
After typing in "run diag CPI", Eviews gives me an error message saying that this is illegal. Any idea why this is so? Thanks!

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

Re: Passing on program argument to a string var

Postby EViews Gareth » Tue Jan 27, 2009 10:46 am

%name = %0
Follow us on Twitter @IHSEViews

renjinlu
Posts: 14
Joined: Tue Jan 06, 2009 8:34 pm

Re: Passing on program argument to a string var

Postby renjinlu » Tue Jan 27, 2009 12:18 pm

Thanks, Gareth. You are always the last resort :)

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

Re: Passing on program argument to a string var

Postby EViews Gareth » Tue Jan 27, 2009 12:22 pm

Thanks.... I guess?
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 30 guests