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

Home » Public Forums » archive » Global variable vs common block
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: Global Variable [message #26830 is a reply to message #19399] Mon, 01 October 2001 08:33 Go to previous messageGo to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
Martin,
The following URL points to a tiny file that does what you want.
http://spot.colorado.edu/~romashki/idl/single_set.sav
You can see basic description by typing
SINGLE_SET, /HELP
To set a global variable, use
SINGLE_SET, 'The_Name', My_State[, /NO_COPY]
To read it, use
My_State = SINGLE_GET('The_Name'[, /NO_COPY])
To kill it:
SINGLE_KILL, 'The_Name'
There is no limit on the number of named global variables.
If you did not keep track of global pointers using GET_HANDLE then
HEAP_GC will be able to kill them, as they exist as dangling references.
In this case, call to SINGLE_GET will re-create the named global
variable, but, of course, not its contents.
However, they are accessible via SINGLE_GET at any time.
Cheers,
Pavel
Disclaimer: I do not support using global variables. Provided procedure was
only written as an alternative to using COMMON blocks for those rarest
cases when widget programs are absolutely independent but benefit from
being aware of each other.

Martin Downing wrote:
>
> Reimar,
>
> If this is to be a global variable, do you have a cunning method of locating
> and identifying this variable off the heap?
>
> Martin
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Input Buffer Error Reading in Large ascii Files
Next Topic: General info question for newbie

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

Current Time: Wed Oct 08 13:55:36 PDT 2025

Total time taken to generate the page: 0.00182 seconds