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

Home » Public Forums » archive » Re: Preserving Variables
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Preserving Variables [message #10190 is a reply to message #10183] Thu, 30 October 1997 00:00 Go to previous messageGo to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
Matthew Hanson <matt@ktaadn.com> writes:

> Hello,
> Anyone know how to make statis variables? That is, upon returning to a
> function, how can i create a variable that has the same value as when i
> left the function before? I really don't want to use Common Blocks.
> -matt

I understand your concern about common blocks, but if a common block is
restricted to a single routine for the sole purpose of retaining information
between calls, then I think most of those concerns disappear. I make such a
"private" common block have the same name as the routine, to avoid running into
a common block of the same name from another routine.

The other way to preserve data, of course, is to use DEFSYSV to define a global
system variable, but that can be rather awkward.

It would be nice if IDL had a RETAIN statement, similar to the COMMON
statement, that could be used to retain internal variables between calls.

Bill Thompson
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: droplist items
Next Topic: Minization of one variable

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

Current Time: Sat Oct 11 02:59:56 PDT 2025

Total time taken to generate the page: 0.64067 seconds