Hi,
I have a question on the use of subroutines. Specifically, I am trying to find if it is possible to create a subroutine and but call it in from other programs when it is not open or part of those programs. The subroutine would run regressions using an equation imported from those programs. Is this possible?
subroutines
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: subroutines
You can use an include statement to include another program that contains a subroutine, which should get you what you want.
Re: subroutines
Thanks! I've used this technique, and am still running into some problems. I want my subroutine to import a specified equation from a workfile. The subroutine shell looks like this
subroutine tolerance(series find_tol)
subroutine tolerance(series find_tol)
Code: Select all
endsub
I have saved this subroutine into a program called tolerance.prg. To call this subroutine from another program, I have
include tolerance
call tolerance(mcons)
where tolerance is the name of the program and the name of the subroutine, and mcons is the name of the equation I want to analyze in the open workfile. When I try to run this program, I get the message, "Type mismatch in arguement 1 in "CALL TOLERANCE(MCONS)"" I'm not sure what I am doing wrong, since I am copying the syntax I see in Eviews help. I don't specify a workfile, because I just want it to refer the the workfile most recently opened/worked with.
Could you please advise on what I am doing wrong? Thanks!-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: subroutines
The problem is exactly as the error message indicates - you've created a subroutine that accepts a series, yet you're passing in an equation.
Re: subroutines
ha - thanks. That wasn't registering for some reason.
Who is online
Users browsing this forum: No registered users and 2 guests
