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

Home » Public Forums » archive » Re: Variable name from string without EXECUTE
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: Variable name from string without EXECUTE [message #37506] Fri, 19 December 2003 07:48
Jonathan Joseph is currently offline  Jonathan Joseph
Messages: 69
Registered: September 1998
Member
I received this quick reply via email from RSI, which provides an
excellent solution. I post it here for your enjoyment.

-Jonathan

You could create an anonymous structure from your input file
name/value pairs (see CREATE_STRUCT), then pass the structure
through as an _EXTRA keyword to your target function or
procedure.


Here's a simple example


Field = 'linestyle'
value = 3
extra = create_struct(field, value)
test, _extra = extra


Pro Test, linestyle = linestyle, other = other
Plot, Findgen(10), Linestyle = linestyle
Print, 'Was other passed? ', n_elements(other) ne 0
End


You can retrieve information about allowed keywords to
user-written procedures via the /PARAMETERS keyword
to ROUTINE_INFO. (There is no equivalent for system-level
IDL routines.)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Variable name from string without EXECUTE
Next Topic: TWINS

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

Current Time: Fri Oct 10 14:35:21 PDT 2025

Total time taken to generate the page: 1.75674 seconds