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

Home » Public Forums » archive » Re: Strings as variables?
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: Strings as variables? [message #24165] Sat, 10 March 2001 10:03
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
"B. R. Bojkov" wrote:
>
> Hello All,
>
> I am writing a "general" HDF extraction subroutine using IDL 5.4 and I
> am stuck...
>
> Let me explain:
>
> 1. I read from an HDF file the names (strings) representing the
> different data arrays found in the given file (this can change from
> file to file).
>
> 2. I successfully extract the different data arrays found in the file
> and assign them to their matching dataset names using the EXECUTE
> command.
>
> 3. What I want to do next is pass the actual data variables (with
> their appropriate name from point 2.) to another subroutine (I want
> to pass the actual variables, not the string containing their names).
>
> Am I missing something big? Any suggestions?
>
> Thanks in advance,
>
> Bojan


Hi,

you should use structures.

because then you do not need EXECUTE. x=CREATE_STRUCT(name,data)

If you are using EXECUTE you will never be able to use your
routines in RUNTIME.

I have already a tool to read in the total datasets into a structure.
(ICG-DATA-STRUCTURE). If you are interested please give me a note.

This data structure is explained in my publication:
http://www.fz-juelich.de/zb/text/publikation/juel3786.html


regards

Reimar






--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
=============================================
a IDL library at ForschungsZentrum J�lich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml

http://www.fz-juelich.de/zb/text/publikation/juel3786.html
Re: Strings as variables? [message #24170 is a reply to message #24165] Fri, 09 March 2001 15:10 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
brbojkov@netscape.net (B. R. Bojkov) writes:

> Hello All,
>
> I am writing a "general" HDF extraction subroutine using IDL 5.4 and I
> am stuck...
>
> Let me explain:
>
> 1. I read from an HDF file the names (strings) representing the
> different data arrays found in the given file (this can change from
> file to file).
>
> 2. I successfully extract the different data arrays found in the file
> and assign them to their matching dataset names using the EXECUTE
> command.
>
> 3. What I want to do next is pass the actual data variables (with
> their appropriate name from point 2.) to another subroutine (I want
> to pass the actual variables, not the string containing their names).
>
> Am I missing something big? Any suggestions?

You probably aren't missing something big. The answer is to also call
the subroutines mentioned in number 3 by using the EXECUTE statement
as well. This sounds kind of kludgey, but that's probably because
steps 1 and 2 are a bit kludgey as well. I'm wondering, why does the
name of the variable make a difference? Couldn't you just call it
DATA in your procedure?

If the number of variables is itself variable, then this is a time to
use pointers, or more specifically arrays of pointers.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: interactive color changes within a procedure
Next Topic: printing floats/integer

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

Current Time: Sat Oct 11 08:47:55 PDT 2025

Total time taken to generate the page: 2.64031 seconds