Re: Attached function doesn't count in IDL 5.1? [message #12349] |
Fri, 17 July 1998 00:00 |
Martin Schultz
Messages: 515 Registered: August 1997
|
Senior Member |
|
|
Richard G. French wrote:
>
> Pao-hung LIN wrote:
>>
> [...]
>
>> 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
I noticed, too, that something must have changed between IDL 4.x and
5.x: I keep getting those error messages about undefined variables, and
I usually eliminate them with a FORWARD_FUNCTION statement. But I have
the impression this wasn't always necessary in 4.x . But in a way, this
function declaration makes the code a little "cleaner", so I am not too
sorry about it.
Martin.
--
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Earth&Planetary Sciences, Harvard University
109 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA
phone: (617)-496-8318
fax : (617)-495-4551
e-mail: mgs@io.harvard.edu
Internet-homepage: http://www-as.harvard.edu/people/staff/mgs/
------------------------------------------------------------ -------
|
|
|
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
|
|
|