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

Home » Public Forums » archive » COMMON block question
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: common block question [message #75723 is a reply to message #23576] Wed, 13 April 2011 14:17 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
geoff writes:

> I am writing a program which will call a number of subroutines. I
> have a number of arrays, the largest of which (and will take a
> significant part of the memory) will be used in most (but not all) of
> the subroutines, will be created at the beginning and be retained
> until the end of the program.
>
> Is it easiest for me to define a common block in the main program with
> this main array and make this block available to the other sub
> routines when necessary? Is there any overhead in making the block
> available to all sub routines?
>
> I really just want to use a few global variables which are available
> to the whole list of programs

Sounds like a legitimate use of a common block
to me. Although passing the routine by reference
or passing a light-weight pointer would always
be my preference. It makes the code easier to
understand months later, for one thing. And it
allows me to run multiple instances of my program
(maybe not important here).

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL 8 GUI won't save all overplots on one image...help!!
Next Topic: Cross signs when using postscript font

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

Current Time: Wed Oct 08 18:07:18 PDT 2025

Total time taken to generate the page: 0.00405 seconds