Re: saving variables between calls to a procedure? [message #31608 is a reply to message #31607] |
Wed, 31 July 2002 15:26   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst (paul.vandelst@noaa.gov) writes:
>> pro define,ptr
>> *ptr=[*ptr,10]
>> end
>
> Hmm. That seems like an extremely dangerous thing to do - couldn't you clobber something
> by concatenating like that? If IDL is smart enough to recognise that the next bit of
> memory may be used by something else it then seems that you would end up with a
> non-contiguous data structure (in the figurative).
This doesn't seem dangerous to me (perhaps because
I use the construct all the time). It seems like
one of those wonderful things IDL occasionally does
that makes you think to yourself "Now, by God, that's
how software *ought* to work!"
In any case, it works, over and over and over. And it
never occurred to me that non-contiguous data storage
could be involved, even remotely. Not only that, I
don't even have pointer memory leaking like a sieve,
which--I think--is the totally miraculous part. :-)
Cheers,
David
--
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
|
|
|