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

Home » Public Forums » archive » Re: Access array elements with String
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Access array elements with String [message #61351 is a reply to message #61350] Mon, 14 July 2008 12:49 Go to previous messageGo to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
> It looks like the asterisk character is interpreted as something
> different inside the brackets of an array.
> This interpretation is not a string '*', so that would explain the
> error of trying to use the string in this context.
>
> Is anyone familiar with how to reformat the * in such a way so as the
> interpreter would recognize it ?
>
> Thanks in advance,
> --Justin

well... Bob gave you two solutions already
0:s[n] and
indgen(s[n])

Now if you really want to use the *, you might want to have a look at
the command "execute"
IDL> a = '*'
IDL> b = indgen(3,3)
IDL> c = '1'
IDL> tmp= execute('e = b[' + c + ',' + a +']')
IDL> print,e
1
4
7

but be aware of the limitations of this command (read the help)
Jean
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL 7 bookmarks
Next Topic: Re: centering dialog_pickfile, printersetup, etc...

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

Current Time: Thu Oct 09 08:57:51 PDT 2025

Total time taken to generate the page: 0.07894 seconds