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 #75721 is a reply to message #23576] Wed, 13 April 2011 16:21 Go to previous messageGo to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Apr 13, 6:17 pm, David Fanning <n...@dfanning.com> wrote:
> 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).

To me it sounds like the classical case where there are much better
options than global variables. That is, any case when there is a way
around using global variables.

Depending on the relation of the variables and how they are going to
be used, I would consider one of:

1) Putting then into a structure (of the arrays themselves or pointers
to them), and passing it around.
2) Passing around an array of pointers, where each element pointed to
one of the arrays.
3) Passing around a list or hash, depending on which makes it easier
to organize the arrays.
4) Making an object of the whole thing and keeping those arrays in one
or more fields of self.
[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 20:14:42 PDT 2025

Total time taken to generate the page: 0.00421 seconds