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

Home » Public Forums » archive » Re: Restoring Data within a Procedure
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Restoring Data within a Procedure [message #8555] Fri, 04 April 1997 00:00
Marty Ryba is currently offline  Marty Ryba
Messages: 16
Registered: May 1996
Junior Member
D.H.Brooks wrote:
> I have a widget that I use to select IDL save/restore files and so when I pick
> one I'm within a compound widget at a lower level than the main program. This means
> that I get the message;
>
> % Identifiers can only be added or deleted at the main level: STRUCTURE.
>
> How would I go about getting rid of this? Can anyone help?

The key is that you cannot *add* variables within a compiled
procedure. However, in IDL you can *always* change the size/type of any
already-declared variable. So, if your SAVE/RESTORE files always have
the same variables (which I assume is the case since you are picking one
of several files for supposedly identical processing), you pre-declare
the variables.

Here's a simple example:

FUNCTION do_restore, filename

structure = 0 ; Creates identifier for variable within
; save/restore file
restore, filename

return, structure ; return to calling function
END

--
Dr. Marty Ryba | Of course nothing I say here is official
MIT Lincoln Laboratory | policy, and Laboratory affililaton is
ryba@ll.mit.edu | for identification purposes only,
| blah, blah, blah, ...
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Hyperhelp on Linux
Next Topic: Restoring Data within a Procedure

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

Current Time: Wed Oct 08 17:42:24 PDT 2025

Total time taken to generate the page: 0.00528 seconds