saving name of equation as a string object

For questions regarding programming in the EViews programming language.

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

yoniboi
Posts: 16
Joined: Mon Oct 12, 2009 5:26 am

saving name of equation as a string object

Postby yoniboi » Thu Jan 21, 2010 1:53 am

i want to build a sub that one of the input variables is an equation.

i want to output a graph object that has the same name as the equation just with the ending eq_name_graph where eq_name is the equation name.

I would think this is possible i just cant find the function for it in the help.

I am using eviews 6

Thank You

Yoni

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

Re: saving name of equation as a string object

Postby EViews Gareth » Thu Jan 21, 2010 9:31 am

This actually can't be done in EViews 6 (at least I can't think of a way). You'll have to use EViews 7, where you can use the @name data member to retrieve the name.

yoniboi
Posts: 16
Joined: Mon Oct 12, 2009 5:26 am

Re: saving name of equation as a string object

Postby yoniboi » Thu Jan 21, 2010 2:00 pm

another question i had was being able to loop through all the names of objects in a page (or workfile) so when i generate in a program a graph and it already exists the program crashes. I use delete a lot in the code, but if the object isnt there then the program crashes again.

i would rather put an if in a loop so it will look for the name and if it finds it then deletes it if not then moves on.

thank you

yoniboi

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

Re: saving name of equation as a string object

Postby EViews Gareth » Thu Jan 21, 2010 2:43 pm

You can use @isobject to test whether an object exists.

yoniboi
Posts: 16
Joined: Mon Oct 12, 2009 5:26 am

Re: saving name of equation as a string object

Postby yoniboi » Fri Jan 22, 2010 12:32 am

ok,

thanks for the help

yoniboi


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests