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

Home » Public Forums » archive » Re: elementary SAVE and COMMON BLOCKS
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: elementary SAVE and COMMON BLOCKS [message #56442] Wed, 31 October 2007 12:15
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Libertan writes:

> I'll assume there's a good reason
> for not being able to save a common block within a procedure.

I'm certain there is. I just don't have the foggiest idea
what it might be. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: elementary SAVE and COMMON BLOCKS [message #56443 is a reply to message #56442] Wed, 31 October 2007 11:20 Go to previous message
Libertan is currently offline  Libertan
Messages: 8
Registered: February 2007
Junior Member
Thankyou very much David Fanning. Yes, I misunderstood; I thought
MAIN LEVEL referred to the level at which the common block was
defined. Unbounded idiocy. I need to change my block saving program
from a procedure to a batch file. I'll assume there's a good reason
for not being able to save a common block within a procedure.
Re: elementary SAVE and COMMON BLOCKS [message #56458 is a reply to message #56443] Tue, 30 October 2007 20:21 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Libertan writes:

> I have a very basic problem. I can't seem to save common blocks.
> Having read the documentation and tried SAVE with all its options (and
> permutations of them) I have still had no luck. I am, to be honest,
> completely stymied.
>
> Take for example,
>
> PRO main
> common DATA, a
> a=9
> save, /ALL, filename='junk.sav'
> END
>
> As I understand it, this should save the DATA common block which
> contains the variable A.

I think you misunderstand the documentation. All *main level*
common blocks are saved. Nothing whatsoever is said about
common blocks inside procedures and functions, and I presume
they are NOT saved. You might try something like this:

PRO main
common DATA, a
a = 9
END

common DATA, a
Print, a
Save, /ALL, filename='junk.sav'
END

That seems to work.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Superimposing Images with iimage
Next Topic: IDL 6.4.1 patch for Leopard

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

Current Time: Wed Oct 08 13:51:33 PDT 2025

Total time taken to generate the page: 0.00524 seconds