List->toArray() with structures in IDL 8.1 [message #76999] |
Mon, 18 July 2011 16:05 |
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?
|
|
|