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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Delete COMMON [message #36779] Tue, 28 October 2003 12:43
the_cacc is currently offline  the_cacc
Messages: 104
Registered: October 2001
Senior Member
mperrin+news@cymric.berkeley.edu (Marshall Perrin) wrote in message news:<bnkbh7$2enb$1@agate.berkeley.edu>...
>
> 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

Hey, great suggestion. I've put in a /CLEAN keyword to tell the code to initialise.

Thanks dude.
Re: Delete COMMON [message #36785 is a reply to message #36779] Mon, 27 October 2003 15:59 Go 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
Re: Delete COMMON [message #36786 is a reply to message #36785] Mon, 27 October 2003 15:30 Go to previous message
the_cacc is currently offline  the_cacc
Messages: 104
Registered: October 2001
Senior Member
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.
Re: Delete COMMON [message #36788 is a reply to message #36786] Mon, 27 October 2003 09:08 Go to previous message
Pavel Romashkin is currently offline  Pavel Romashkin
Messages: 166
Registered: April 1999
Senior Member
I am not so sure I regret not being able to run .reset_all or format c:
/y from inside my code. Might throw users off the track :-)
Cheers,
Pavel

David Fanning wrote:
>
> trouble writes:
>
>> I've been running a program with a COMMON block. To delete is, it
>> seems that .reset is the only option. However, I *always* seem to
>> forget to do it so it's only after 1/2 hour of processing, when the
>> results are clearly wrong, that I remember and have to start over.
>>
>> Is there any way to put a .reset in the code, so it always run fresh?
>
> No. Executive commands ("dot commands") can only be
> run from the IDL command line. :-(
>
> Cheers,
>
> David
>
> P.S. Let's just say Common blocks, like taxes, are
> something we have to be responsible for ourselves in
> the eyes of the law.
>
> --
> David W. Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Phone: 970-221-0438, E-mail: david@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
Re: Delete COMMON [message #36789 is a reply to message #36788] Mon, 27 October 2003 08:36 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
trouble writes:

> I've been running a program with a COMMON block. To delete is, it
> seems that .reset is the only option. However, I *always* seem to
> forget to do it so it's only after 1/2 hour of processing, when the
> results are clearly wrong, that I remember and have to start over.
>
> Is there any way to put a .reset in the code, so it always run fresh?

No. Executive commands ("dot commands") can only be
run from the IDL command line. :-(

Cheers,

David

P.S. Let's just say Common blocks, like taxes, are
something we have to be responsible for ourselves in
the eyes of the law.

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Delete COMMON [message #36790 is a reply to message #36789] Mon, 27 October 2003 08:32 Go to previous message
mperrin+news is currently offline  mperrin+news
Messages: 81
Registered: May 2001
Member
trouble <the_cacc@hotmail.com> wrote:
> I've been running a program with a COMMON block. To delete is, it
> seems that .reset is the only option. However, I *always* seem to
> forget to do it so it's only after 1/2 hour of processing, when the
> results are clearly wrong, that I remember and have to start over.
>
> Is there any way to put a .reset in the code, so it always run fresh?

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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: big file navigation
Next Topic: Hyperthreading

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

Current Time: Wed Oct 08 13:07:10 PDT 2025

Total time taken to generate the page: 0.00718 seconds