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

Home » Public Forums » archive » Re: One file for each procedure/function?
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: One file for each procedure/function? [message #30338 is a reply to message #30336] Fri, 19 April 2002 06:19 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Pepijn Kenter wrote:

> I'm currently writing analyses software (small programs plus routines) for
> an ozon measurement device and I'm new to IDL. A lot of the routines and
> programs have already been written and are ready for me to use. These
> routines have been grouped together in a few .pro files. These files are
> then compiled explicitly (by .compile statements) in the main programs. The
> programs are called from the command line.

Just to add a bit to Riemar's useful advice, it is useful
to think of a program file as an IDL "command" you
are building. The procedure or function that has the
same name as the command (and the file) should be the last
module in the file. Other procedures and functions that are
used by the command module for its internal use can also be
placed in the file, but always above (in front) of the
command module in the file. In this way, everything is
compiled properly when the "command" is used.

Reimer is correct in recommending that these utility
routines be named starting with a base "command" name.
Otherwise, you have command name chaos and you can never
be sure what procedure or function with this name you
are actually running. For example, naming an event
handler module "Quit" is always a bad idea. The name
"MyProgram_Quit" is much more specific.

Sometimes utility routines take on a life of their own,
and we find them to have wider use than we expected them
to initially. In this case, we take them out of the command
file and place them in a command file of their own, so
they can enjoy wider use by other programs that want to
use them.

It is not unusual to place the programs from an entire
application in separate directories according to
functionality, etc. But typically, these are subdirectories
of an "application" directory that can be added to a user's
Path easily.

By the way, you are correct in thinking that the use
of compile statements goes completely against the
IDL WAY. They are typically used only as a last
resort to sort out command name chaos (see above). :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Chain-Link Algorithm for Perimeter
Next Topic: Re: Chi-square decision trees

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

Current Time: Sat Oct 11 14:44:48 PDT 2025

Total time taken to generate the page: 0.48940 seconds