Re: Linking multiple files... [message #31512 is a reply to message #31505] |
Mon, 22 July 2002 19:35   |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
squad@hotmail.com (Bob) 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.
David's solution is the correct one. The quick and dirty solution is
to put:
forward_function findroots
within PRINT_TO_FILE, before the first reference to FINDROOTS() is
made.
The problem is that IDL doesn't know whether you are referring to an
function or an array, since both are accessed using the () notation.
Since you didn't keep FINDROOTS in its own self-named file, IDL won't
know about it and assume that references to FINDROOTS are array
references. The above hint helps IDL decide.
Good luck,
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|