elementary SAVE and COMMON BLOCKS [message #56463] |
Tue, 30 October 2007 18:13 |
Libertan
Messages: 8 Registered: February 2007
|
Junior Member |
|
|
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.
PRO check
restore, 'junk.sav'
help
END
This should reveal that A is in DATA. I used procedures to ensure the
common block is destroyed before restore is invoked. i suppose
resetting idl at the half way point would also work.
Anyway, I find that A is saved as a local variable and there's no sign
of the existence of the DATA common block. I've tried HELP, the
bottom panel of the IDLDE GUI and the object method IDL_Savefile, all
of which have confirmed that junk.sav contains no common blocks.
Furthermore, and very confusingly, it seems I can't compile IDL
procedures which reference DATA without DATA being previously defined
in one of them. This seems to preclude the possibility of loading a
common block of unknown size/contents. If common blocks always have
to be explicitly defined, then what's the point in saving a common
block? You might as well just save the variables.
A million thanks in advance.
TSL
|
|
|