Hey there,
I am writing a subroutine that requires looking data up from a table. I tried to use "subroutine local" because I don't want the program to store any intermediate elements, but somehow I couldn't make it recognize that the table exists (I just refer to the table "TABLE(!i+1,1)" and it keeps saying that it is not defined. Does tables work within local subroutines? Please let me know. Thanks.
Tchaithonov
Subroutine Local
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
tchaithonov
- Posts: 168
- Joined: Mon Apr 13, 2009 7:39 am
- Location: New York City
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Subroutine Local
You called your table "table"?
-
tchaithonov
- Posts: 168
- Joined: Mon Apr 13, 2009 7:39 am
- Location: New York City
Re: Subroutine Local
No ;) Just an example. If you want, call it tab_abc.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Subroutine Local
Seems to work for me:
Code: Select all
create u 100
table a
call foo(a)
show a
subroutine local foo(table mytable)
!i=1
mytable(!i+1,1) = "hello"
endsub
Who is online
Users browsing this forum: No registered users and 1 guest
