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 #15206 is a reply to message #11537] Tue, 27 April 1999 00:00 Go to previous messageGo to previous message
Struan Gray is currently offline  Struan Gray
Messages: 178
Registered: December 1995
Senior Member
David Fanning, davidf@dfanning.com writes:

> Martin Schultz (mgs@io.harvard.edu) writes:
>>
>> I feel ashamed.
>
> Uh, look, this confession business has me VERY
> nervous.

<smug_git>

I've *never* used a common block, and I strip 'em out of
any code I get from elsewhere.

</smug_git>


An alternative to common blocks that I use extensively is to
create a system variable with a unique name (it helps that I work in a
research group called 'synkrotronljusfysik') and then use it to store
the start handle of a linked list. All my global variables are stored
by name in the list. I have utility routines to add, delete, move and
modify items, and I can create hierarchies by making any list item the
start handle to a sub-list.

All my widget programs know that they can find things like user
preferences, large datasets and default directory names by looking for
the relevant named parameter in the list. When a widget dies, it's
cleanup routine deletes any variables associated only with itself. One
of the reasons I still use handles a lot (despite RSI's rather
sneering insistence that we use pointers these days) is that if a list
is created properly the whole thing can be disposed of automatically
simply by freeing the first handle.

To acheive true IDLguru status I should probably objectify the
whole thing with a singleton instead of a start handle, but it works
well enough that I'm frying other fish for now.


Struan
[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 01:31:12 PDT 2025

Total time taken to generate the page: 0.96243 seconds