Page 1 of 1

Subroutine Local

Posted: Thu Jul 26, 2012 7:47 am
by tchaithonov
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

Posted: Thu Jul 26, 2012 7:51 am
by EViews Gareth
You called your table "table"?

Re: Subroutine Local

Posted: Thu Jul 26, 2012 10:04 am
by tchaithonov
No ;) Just an example. If you want, call it tab_abc.

Re: Subroutine Local

Posted: Sun Jul 29, 2012 6:35 pm
by EViews Gareth
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