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

Home » Public Forums » archive » Re: Obtaining variable names as strings
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: Obtaining variable names as strings [message #25049] Mon, 14 May 2001 08:38
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Martin Schultz wrote:
>
> Ian Dean <ian.d.dean@baesystems.com> writes:
>
> 1.) please don't use html mail in future posts.
>
> 2.) i'm still not entirely sure what you want to do here, but from
> your description it sounds as if there are several things done in
> an unnecessarily complex way? Even if the include file is sacrosanct
> as you say (BTW: I would never accept such a statement), you could
> still treat it as a normal ASCII file and read in the variable definitions
> e.g. into structures like { varname:"Joe", value:"200" } or into
> two arrays: strarr() and values(). This would make searching and
> matching much easier.
>
> 3.) but if you really need to include the include file as such,
> Reimar Bauer can probably tell you how to use the undocumented
> features of routine_name() to achieve what you want.
>
> Martin
>


Hi, Ian

in the past I have used some variables in the same way I think as
you like to do it now.

The following function founds defined variables without structures.
They are removed by some statements in the routine.

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/variab.tar.gz

This function uses the internal routine routine_info. This is an
undocumented routine and it could
be that it will be removed in future releases.
Many routines e.g. Craigs restore or the read_ascii etc. are using some
features of this
routine.

I prefer myself reading variabels in structures mentioned by Martin see
point 2.



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: Obtaining variable names as strings [message #25050 is a reply to message #25049] Mon, 14 May 2001 05:41 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Ian Dean <ian.d.dean@baesystems.com> writes:

1.) please don't use html mail in future posts.

2.) i'm still not entirely sure what you want to do here, but from
your description it sounds as if there are several things done in
an unnecessarily complex way? Even if the include file is sacrosanct
as you say (BTW: I would never accept such a statement), you could
still treat it as a normal ASCII file and read in the variable definitions
e.g. into structures like { varname:"Joe", value:"200" } or into
two arrays: strarr() and values(). This would make searching and
matching much easier.

3.) but if you really need to include the include file as such,
Reimar Bauer can probably tell you how to use the undocumented
features of routine_name() to achieve what you want.

Martin


> <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
> <html>
> Hi All,
> <br>&nbsp;&nbsp;&nbsp; I have an include file containing both variable
> definitions and COMMON block(s). I need to obtain a string representing
> a variable name that is set to a unique value.
> <p>Pro Get_val
> <br>@Vars.inc
> <br>.....
> <br>End
> <p>File Vars.inc:-
> <br>&nbsp;&nbsp;&nbsp; Fred = 100
> <br>&nbsp;&nbsp;&nbsp; Joe =200
> <br>&nbsp;&nbsp;&nbsp; .....
> <br>&nbsp;&nbsp;&nbsp; Mary = 725
> <br>&nbsp;&nbsp;&nbsp; Anne = 812
> <br>Common Rubbish,Fred,Joe,....Mary, Anne
> <p>For instance, if the user gives a value of 200, I require to give the
> string 'Joe'.
> <p>I have been able to use the Help,name='*',out=xxxx to get a list of
> all variables, which can then be interrogated. However, there are a significant
> number of variables and I'm concerned about the time taken to perform this
> in a time-critical operation.
> <p>Some added info:
> <p>1) Is it possible to get a list of common variable names (like IDLDE
> provides) ?
> <br>2) The final program is in "SAVed" format and no longer has access
> to the build files.
> <br>3) The format of the include files is sacrosanct and are defined by
> external sources.
> <br>4) Each of the numbers (100,200....725,812) are unique within this
> file (but obviously not throughout a run).
> <p>I hope there is someone out there who can help, or give me some useful
> pointers.
> <p>Regards,
> <br>&nbsp;&nbsp;&nbsp; Ian
> <br>&nbsp;</html>
>

--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: !version.arch
Next Topic: Displaying large volumes

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

Current Time: Fri Oct 10 08:37:41 PDT 2025

Total time taken to generate the page: 0.64260 seconds