Hi Cecilia,
In order for this to work correctly, the name of the file and the name of the procedure need to be the same. For instance, I wrote a procedure:
pro a
print,'i am in a'
end
and placed it in a file called a.pro
I wrote a procedure:
pro b
print,'now I am in b'
end
and placed it in a file called b.pro.
I wrote a procedure
pro c
a
b
end
and placed it in a file called c.pro.
I started IDL and did the following:
IDL> .compile c.pro
% Compiled module: C.
IDL> c
% Compiled module: A.
i am in a
% Compiled module: B.
now i am in b
IDL>
and it automatically compiled the IDL procedures as long as the file name is the same as the procedure name.
Note also that if there is more than one procedure in the file, it will keep compiling until it gets to a procedure name that is the same as the file's name, which will be the last one compiled. So, for example, if the file b.pro has procedures in it named b, e, f, g, b23 then all the procedures will be compiled up to procedure b, where ever it happens to be in the file. Therefore, in order to compile all the procedures, place procedure b as the last procedure in the file. I've seen this documented but I cannot recall where.
Make sure the naming is correct - I do not recall if IDL procedure names can begin with a numeral.
See the "Automatic Compiling" help, also.
|