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

Home » Public Forums » archive » Re: Delete COMMON
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: Delete COMMON [message #36785 is a reply to message #36779] Mon, 27 October 2003 15:59 Go to previous messageGo to previous message
mperrin+news is currently offline  mperrin+news
Messages: 81
Registered: May 2001
Member
trouble <the_cacc@hotmail.com> wrote:
> mperrin+news@cymric.berkeley.edu (Marshall Perrin) wrote in message news:<bnjhb4$24t7$1@agate.berkeley.edu>...
>>
>> Why do you need to delete the common block? Would deleting all the variables
>> in it be sufficient? See, e.g. delvarx.pro:
>> http://astro.uni-tuebingen.de/software/idl/astrolib/misc/del varx.pro
>>
>> - Marshall
>
>
> Yes, all I need to do is delete the variables. Problem is, it's only
> used deep within a couple of routines, yet I want to destroy it in the
> top level calling function.
>
> It's just so unbearably *painful* to put the COMMON from the numerical
> code into the GUI code and then delete it! COMMON blocks have feelings
> too, you know.

I agree that needlessly proliferating common blocks is no good. I see
two ways out of this situation: One, rewrite the code to not use common
blocks. This may be more of a hassle than it's worth; the way I do this is
to stick all the state into some struct, which then gets passed around
as needed. The problem is that if you expect variable-sized data, you
have to convert everything over to use pointers to access it.

Alternatively, and almost certainly vastly easier, is to modify the
parts of your code that has this common routine to have an initialize()
or clear() function of some kind, which would itself be called from the
top level GUI. That's probably what I would do in your situation...

- Marshall
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: big file navigation
Next Topic: Hyperthreading

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

Current Time: Wed Oct 08 16:58:13 PDT 2025

Total time taken to generate the page: 0.00341 seconds