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

Home » Public Forums » archive » global variables and IDLSPEC issues
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: Global variables and IDL [message #14988 is a reply to message #11537] Wed, 14 April 1999 00:00 Go to previous messageGo to previous message
luthi is currently offline  luthi
Messages: 20
Registered: March 1999
Junior Member
> Use a common block. That requires adding only one extra statement to each
> routine that uses an element of the common, and requires no other code
> changes.

I just did this recently when writing code with some 30 subroutines calling
each other and being called by procedures for optimization (IMSL-routines of
PV-Wave). I found no other way to share huge arrays of data between all
routines than by using COMMON blocks and thus created some 20 of them.
Of course not every block is shared between all routines, but in this way I
can select the ones I need.

Further I was concerned with the speed issue and thought, that COMMON blocks
would be a good idea instead of actually passing variables (huge arrays) as
paramters to routines which are called some 100000 times, which would result in
a large overhead of memory assignment and data type checking. (Okay, probably
I should have used C or Fortran, but Wave is that convenient...)

Does anybody have an idea wheter COMMON blocks could help speed up a program?
And has anybody an idea wheter COMMON blocks are evil?

> In the past 7-8 years I've found more use for GOTOs than
> I have for common blocks, and I NEVER use a GOTO if I
> can avoid it. :-)

For me it's inverse: I absolutely NEVER use a GOTO (actually I forgot how to
use it... the old Basic times are so far! ;-) but I make plenty use of COMMON
blocks.

Cheers

Martin
--
============================================================
Martin Luethi Tel. +41 1 632 40 92
Glaciology Section Fax. +41 1 632 11 92
VAW ETH Zuerich
CH-8092 Zuerich mail luthi@vaw.baum.ethz.ch
Switzerland
============================================================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Reading DXF?
Next Topic: Help for Wav

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

Current Time: Fri Oct 10 03:51:25 PDT 2025

Total time taken to generate the page: 1.04197 seconds