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

Home » Public Forums » archive » List->toArray() with structures in IDL 8.1
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
List->toArray() with structures in IDL 8.1 [message #76999] Mon, 18 July 2011 16:05
b_gom is currently offline  b_gom
Messages: 105
Registered: April 2003
Senior Member
I get the following error when I try to use the toArray method on a
list which contains only one structure:

IDL> s={a:1,b:2}
IDL> l=list(s)
IDL> help,l->toarray()
% FIX: Struct expression not allowed in this context:
<PtrHeapVar4598>.
% Execution halted at: $MAIN$

If the list has more than one element, then things work normally:

IDL> l=list(s,s)
IDL> help,l->toarray()
<Expression> STRUCT = -> <Anonymous> Array[2]

I would expect the list with a single structure to behave just like
the list of scalars does:

IDL> x=23
IDL> l=list(x)
IDL> help,l->toarray()
<Expression> INT = Array[1, 1]

Am I missing something obvious?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: interpolate with missing values
Next Topic: yband help

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

Current Time: Wed Oct 08 15:48:22 PDT 2025

Total time taken to generate the page: 0.00544 seconds