comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Temporary variables still checked out
items: Re: Temporary variables still checked out

Temporary variables still checked out
type: item
description: I seem to be having problems with this program. It creates a blocking widget, which has loads of exclusive and nonexclusive buttons on it, in columns. It is identical to the widget that pops up, when you do 'new plot' in IDL's insight. Every time I run it, if I hit the okay button, I get the message from IDL 'Temporary variables still checked out', or at least it's virtually like that, after the program exits. I've reduced the code down, and I'm pretty sure that the problem is in the code below. In fact the exact lines, seem to be after I've found out that the button was 'ok', and before I destroy the widget. When I commented these lines out I no longer got the 'Temporary variables still checked out'. I don't know what's going on, but is it something to do with the structures and passing by value etc. Cheers, Phil P.S. If you reply could you post it please as I need to see it at work. ;----------------------------------------------------------- ------------ -------------------- getOptions ;----------------------------------------------------------- ------------ -------------------- PRO getOptions_Events, event ;Find out the button value CASE buttonValue OF 'Cancel' : Widget_Control, event.top, /Destroy 'OK' : BEGIN FOR i=0, N_Elements(info.optionsID)-1 DO BEGIN ;Loop through the columns and get the value Widget_Control, info.optionsID[i], Get_Value=thisOption IF info.exclusive[i] EQ 1 THEN BEGIN ;This is exclusive ((*(info.ptr)).optIndex)[i,*] = 0 ((*(info.ptr)).optIndex)[i,thisOption] = 1 ((*(info.ptr)).optString)[i,*] = '' ((*(info.ptr)).optString)[i,thisOption] = info.options[thisOption] ENDIF ELSE BEGIN ;This is non exclusive ((*(info.ptr)).optIndex)[i,*] = thisOption ((*(info.ptr)).optString)[i,*] = '' ((*(info.ptr)).optString)[i,thisOption] = info.options[thisOption] ENDELSE ENDFOR (*(info.ptr)).cancel = 0 ; Destroy the widget program Widget_Control, event.top, /Destroy END ENDCASE END ;----------------------------------------------------------- ------------ -…
creator: Phil Aldis
date: 1999-05-26T07:00:00-00:00

Re: Temporary variables still checked out
type: item
description: Peter Mason wrote: [..] >> ((*(info.ptr)).optIndex)[i,*] = 0 > => Instead of this, try (*info.ptr).optIndex[i,*]=0; etc. > > Things DO get a bit unsettling when (structures of) pointers to > structures are involved, but a bit of command line action will > normally clarify IDL's workings with brackets soon enough. (Basically, > you must restrict your bracketing to just the pointer component(s).) Which reminds me that I should have registered my wish for a pointer-to-structure-dereference operator (like C) with RSI.... What link was that..? Wouldn't it be great to be able to say just info.ptr-->optIndex[i,*] instead of all that gibberish..... And as for the "name" of the operator, there shouldn't be any real problem in using "->" even though it's also used for objects, but if they want to avoid the extra checking, they could go for "-->" like above instead.... or something else. What *really* bugs me is why on earth they didn't provide an operator like this in the first place when they introduced pointers..... But by all means, don't get me wrong, pointers and objects are the best things to happen to IDL since.... well, ... since ... hmm, since I discovered the Emacs editing/shell mode for IDL! Regards, Stein Vidar
creator: steinhh
date: 1999-05-27T07:00:00-00:00