Subroutine - putting the results directly into table

For questions regarding programming in the EViews programming language.

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

jerry
Posts: 2
Joined: Mon Jun 06, 2011 11:59 pm

Subroutine - putting the results directly into table

Postby jerry » Wed Jun 08, 2011 12:16 am

Hello,

Is it possible (Eviews 6) to put the scalar result of subroutine directly into table through the argument? I mean something like the following structure (not working):

Code: Select all

table(5,5) myresults subroutine local abc (series x, series y, scalar z) z = @obs(x) + @obs(y) endsub call abc(ser1, ser2, myresults(1,1))
instead of (working):

Code: Select all

table(5,5) myresults subroutine local abc (series x, series y, scalar z) z = @obs(x) + @obs(y) endsub scalar temp call abc(ser1, ser2, temp) myresults(1,1) = temp
Thank You in advance.

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Subroutine - putting the results directly into table

Postby trubador » Wed Jun 08, 2011 12:40 am

Code: Select all

table(5,5) myresults subroutine local abc (series x,series y,table t,scalar i,scalar j) t(i,j) = @obs(x) + @obs(y) endsub call abc(ser1,ser2,myresults,1,1)
If you are not planning to use it in a loop, you can get rid of the scalar arguments...


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests