Re: functions considered as variables [message #11212 is a reply to message #11056] |
Fri, 06 March 1998 00:00  |
Selwyn Yee
Messages: 1 Registered: March 1998
|
Junior Member |
|
|
I've seen this before. It happens when, in your .pro file, you are
trying to call a function which has not yet been compiled. Either the
function is in a
different module, or is in the same .pro file, but below your calling
statement.
Because IDL is an interpretive language, it executes and/or compiles the
code in your .pro file from top to bottom. Your function call:
junk = getlatlon(alt_gps)
looks just like you are subscripting an array, if IDL hasn't yet
compiled your
function getlatlon.
The solution is to use the forward_function command in IDL. The syntax
is:
forward_function function1, function2, ...
So for you, you would precede your function call with:
forward_function getlatlon
Hope this does the trick for you.
--
Selwyn M.T. Yee Phone: (650) 604-2861
Airborne Sensor Facility Fax: (650) 604-4987
NASA Ames Research Center Email: syee@mail.arc.nasa.gov
gbust@arlut.utexas.edu wrote:
>
> This might be related to my previous post - I don't know. Anyway, I am
> buzzing away, my driver code calling other routines just fine. I have
> compliled a .pro file that has a bunch of routines in it, and all of a sudden,
> I am stopped in my driver routine at:
> junk = getlatlon(alt_gps)
> with the error notice: variable getlatlon not found.
>
> So I do a help, and sure enough it says getlatlon is a function. So, before
> returning to main, i.e. right where the code stopped, I just type the above
> from the command line - and it works fine. What gives?
>
> Thanks a lot in advance.
>
> -Gary
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
|
|
|