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

Home » Public Forums » archive » Re: new to IDL - question about modularity
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: new to IDL - question about modularity [message #54581 is a reply to message #54572] Fri, 22 June 2007 19:46 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Josh writes:

>
> despite having five manuals on IDL in front of me, I'm having some
> trouble with writing modular code. I think it lies in my lack of
> understanding of the structure, but hopefully it's a simple issue...
>
> I'm using IDL 6.3, and have written a single .pro file that looks
> like,
>
> pro xxx
> ...
> end
>
> pro yyy
> ...
> end
>
> pro zzz
> ...
> end
>
> in an effort to break up the tasks to be done. However, within the
> zzz procedure I would like to access an array that was built in the
> xxx procedure. I realize that's not possible, and was hoping for some
> guidance as to a better way to do this.

The simplest way to do this, and maybe the only way if
there is really no connection between the three modules
in your example, is to use a common block to store the array.

If there is a connection (e.g., zzz calls xxx), then you
can pass information around by means of output keywords
or even pass a pointer variable around that can be filled
out by individual modules.

There really should be some kind of connection, or these
procedures shouldn't be in the same file. That is to say,
the only reason xxx and yyy should be in the same file
as zzz is that they are utility routines for zzz. Thus,
a common block is rarely (I almost said never) needed.
They should be able to pass all their information via
keywords and parameters. :-)

http://www.dfanning.com/tips/namefiles.html

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Idl 5.6 &linux
Next Topic: Re: IDLffXML

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

Current Time: Fri Oct 10 15:11:09 PDT 2025

Total time taken to generate the page: 1.67572 seconds