How IDL Resolves Routines
When IDL encounters a call to a function or procedure, it must find the routine to call. To do this, it goes through the following steps. If a given step yields a callable routine, IDL arranges to call that routine and the search ends at that point:
- If the routine is known to be a built-in intrinsic routine (commonly referred to as a system routine), then IDL calls that system routine.
- If a user routine written in the IDL language with the desired name has already been compiled, IDL calls that routine.
- If a file with the name of the desired routine (and ending with the filename suffix
.pro) exists in the current working directory, IDL assumes that this file contains the desired routine. It arranges to call a user routine, but does not compile the file. The file will be compiled when IDL actually needs it. In other words, it is compiled at run time when IDL actually attempts to call the routine, not when the code for the call is compiled. - IDL searches the directories given by the !PATH system variable for a file with the name of the desired routine ending with the filename suffix
.pro. If such a file exists, IDL assumes that this file contains the desired routine. It arranges to call a user routine, but does not compile the file, as described in the previous step. - If the above steps do not yield a callable routine, IDL either assumes that the name is an array (due to the ambiguity inherent in allowing parentheses to indicate either functions or arrays) or that the desired routine does not exist (See Arrays for a discussion of this ambiguity). In either case, the result is not a callable routine.