Re: Attached function doesn't count in IDL 5.1? [message #12352 is a reply to message #12349] |
Fri, 17 July 1998 00:00  |
Richard G. French
Messages: 65 Registered: June 1997
|
Member |
|
|
Pao-hung LIN wrote:
>
> The story goes like this, the poly_fit on IDL 4.**
> doesn't goes well with my data( they are single precision)
>
> So I write another one called poly_fita where all the
> variable are double precision.
>
> I attach this function poly_fita at the buttom of my
> main program, called ivds.
>
********* I believe this is the problem - you need to attach
ivds to the TOP of your main program - the function needs
to be defined before the first reference to it.
>
> both ivds and poly_fita will be compiled, but when my ivds
> try to call the poly_fita, IDL 5.1 just tell me that the variable
> is undefined!!!!!!!!!!!!
>
> Under IDL 4.*, the ivds can call the poly_fita all right, but
> not under 5.1 .....WHY?????
It may be that in 4.*, you used a different ordering of your
functtions, or that you first compiled both routines before
running either. It may also be connected with the introduction
of the [] notation for defining arrays.=
My suggestion is to put poly_fita in a separate file called
poly_fita.pro that is on the IDL search path and see if this
helps.
Dick French
|
|
|