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 Jason, EViews Moderator, EViews Matt
-
- Posts: 168
- Joined: Mon Apr 13, 2009 7:39 am
- Location: New York City
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
-
- 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.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- 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
Follow us on Twitter @IHSEViews
Who is online
Users browsing this forum: Google [Bot] and 60 guests