Re: Save and Common Blocks [message #9905] |
Fri, 12 September 1997 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Daniel Williams writes:
> Although the documentation for IDL's 'save' procedure claims that it
> keeps comon blocks, I find that when I resore a session, the common
> blocks are not present. Is this an error on my part, or does 'save'
> really not store the common blocks?
>
> And yes, I do use the '/all' option to 'save'.
The way the common blocks are restored might be confusing you.
For example, if I create a common block named DATA like this:
IDL> Common DATA, c, d
IDL> c = 5
IDL> d = 10
IDL> Save, /All, File='junk.sav'
Then when that common block is restored, what I see are the
variables c and d, but they have the DATA name in parentheses,
like this:
IDL> Restore, 'junk.sav'
IDL> Help
C (DATA) INT = 5
D (DATA) INT = 10
If I declare the DATA common block in an IDL procedure or
function, I now have access to those two variables.
Cheers,
David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
Customizable IDL Programming Courses
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
|
|
|