IDL Fails to Recognize Function
QUESTION: Help!! My IDL programs worked perfectly yesterday, but after the system administrator upgraded to a new version of IDL overnight everything is broken. IDL now thinks all my functions are variables!
IDL> var = Complex_Scaling(image)
Variable is undefined: COMPLEX_SCALING.
Execution halted at: $MAIN$
Please help. My thesis is due Thursday!
![]()
ANSWER: Oh, calm down. You are going to graduate on time.
There are only about three reasons for this error, and two of them are extremely unlikely. About 99 percent of the time, this error is caused by IDL not being able to find the complex_scaling.pro file in the sub-directories listed in the !Path system variable. This is extremely likely if you have recently upgraded to a new version of IDL, because many of your start-up parameters often do not get brought over correctly to the new version. (Parameter migration is done automatically in Windows versions of the installer, if you answer the questions correctly, but is not done as well in UNIX versions of the installer. But, of course, if you are using the UNIX version of IDL you are already used to disappointment, so this shouldn't surprise you.)
Simply add the directories that contain your IDL programs to your IDL !PATH variable. This is done differently, depending upon which version of IDL you are using, and which shell you are using if you are running IDL on a UNIX machine. Consult the IDL on-line help or your Installation Guide for details.
The other two, extremely unlikely, possibilities are (1) this really is a variable, but someone has set COMPILE_OPT STRICTARR, so that square brackets are now needed for array subscripting. This would cause a subscripted variable to be misinterpreted as a function. And (2) this function was referenced before it was compiled.
But I think putting the function source code in your IDL path will solve all your problems. :-)
![]()
Copyright © 2006 David W. Fanning
Last Updated 5 February 2006