comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Function compiles, but get message as if it's not
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Function compiles, but get message as if it's not [message #41095 is a reply to message #41094] Tue, 21 September 2004 20:12 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
Benjamin Hornberger wrote:

> If you do ".compile taco", IDL will search for a file "taco.pro"
> in your path and compile it, recognizing all procedures and functions
> in the file.
>
> If you do "taco, parameters, /keywords", IDL will search for a file
> "taco.pro" in your path and compile everything until it finds a
> PROCEDURE taco. Anything following that won't be compiled. A FUNCTION
> taco won't be recognized.
>
> If you do "result = taco(...)", IDL will search for a file
> "taco.pro" in your path and compile everything until if finds
> a FUNCTION taco. Anything following that won't be compiled. A
> PROCEDURE taco won't be recognized.
>

I believe the 2nd and 3rd paragraphs are not quite correct. They should
be rewritten as:

If you do "taco, parameters, /keywords" OR "result = taco(...)",
IDL will search for a file "taco.pro" in your path and compile
everything until it finds a routine (procedure OR function)
called taco. Anything following that won't be compiled.

To illustrate this, created a file on your path called taco.pro, and
add the following lines

function taco
end

pro taco
end

Now invoke the procedure "taco". IDL prints

IDL> taco
% Compiled module: TACO.
% Attempt to call undefined procedure/function: 'TACO'.
% Execution halted at: $MAIN$

It has compiled the function and then quit, even though it was looking
for a procedure.

> So, make sure the function / procedure which has the same name as the
> file is the last one in the file. This will normally be your "main"
> function / procedure. If other functions / procedures are called
> (needed) exclusively by that "main" one, put them into the same file,
> but above. If any function / procedure might be needed more often, put
> them into their own file.

All good advice, irrespective of the details.

--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: fuzzy c-means clustering IDL code
Next Topic: open HTTP links from a widget

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 02:40:58 PDT 2025

Total time taken to generate the page: 1.04364 seconds