Re: Linking multiple files... [message #31513 is a reply to message #31512] |
Mon, 22 July 2002 17:20  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Bob (squad@hotmail.com) writes:
> Hey everyone... maybe I'm just really dumb, but for some reason I
> can't get IDL to properly link several files together. What I mean by
> link is the following:
>
> --- In one file, I have a function called "FINDROOTS" which finds the
> roots of a quadratic equation (Function FindRoots, a, b, c).
>
> --- In one file I have a procedure "PRINT_TO_FILE", which calls
> FindRoots with a very short list of different a's and b's and c's, and
> then outputs it to a text file.
>
> I open both of these files up in IDL and tell it to "Compile All". In
> the event log it says:
>
> % Compiled module: FINDROOTS
> % Compiled module: PRINT_TO_FILE
>
> So, I run the procedure PRINT_TO_FILE. I immediately get the following
> error:
> % Variable is undefined: FINDROOTS
>
> The strange thing is that if I recompile both yet again (without any
> changes), the error goes away and everything is fine. However, this is
> incredibly annoying. Also, my problem isn't *this simple*, and this
> happens again and again and again .......
>
> Any help would be greatly appreciated.
Put FINDROOTS in a file named "findroots.pro". Put
PRINT_TO_FILE in a file named "print_to_file.pro".
Make sure both of those modules are the *last* module
in their respective files. Put the files somewhere in
your !PATH.
Now you don't have to compile anything and everything
will magically "work". :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|