[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: recursive functions?

Nando Iavarone wrote:
ENVI> .compile recFun
% Compiled module: RECFUN.
% Compiled module: RECFUNTEST.
ENVI> err=recFunTest(12,15)
      12.Prrrr      15.Prrrr
% Variable is undefined: RECFUN.
% Execution halted at:  RECFUN              5
%                       RECFUNTEST         19
%                       $MAIN$
it seems that the first time IDL 'compile' recFun function,
it consider recFun (in the code it is a function) a variable and on run it does not find it.
if I recompile the source, recFun is now in the table of the functions and it works.
as a workaround I compile the source twice and it works, but I don't like this.
I am sure there is something I have not considered.

I don't remember well, but 5.3 would have a mechanism in compiling to avoid this.
Is it true?
Oh oh........ but I am working with 5.2 (to use ENVI 3.2).


Nando Iavarone
Advanced Computer System - SPACE DIVISION
via Lazzaro Belli, 23
00040  Frascati - RM
Tel: +39-6-944091 (switchboard)
          9440968 (direct)