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

Home » Public Forums » archive » LIST to STRUCTURE
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 to STRUCTURE [message #93182] Mon, 09 May 2016 14:51 Go to next message
Jordan Guerra is currently offline  Jordan Guerra
Messages: 5
Registered: August 2012
Junior Member
Hi All,

I have a list that a read in from a data base in the form:

IDL> help, data_str, /str
DATA_STR LIST <ID=6 NELEMENTS=12741>

Each element in this list is an structure itself, for example:

IDL> help, data_str[0], /str
** Structure <1cb83208>, 7 tags, length=112, data length=112, refs=2:
DATA STRUCT -> <Anonymous> Array[1]
FC_ID STRING 'id_string'
LAT_HG DOUBLE 12.086699
LONG_CARR DOUBLE -16.656586
LONG_HG DOUBLE 16.840149
NAR LONG64 804
TIME_START STRING '2013-01-01T00:59:52Z'

Is there a way to transform the list to an IDL structure?

Thanks.
Re: LIST to STRUCTURE [message #93183 is a reply to message #93182] Mon, 09 May 2016 17:32 Go to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
Hi Jordan,

here is some code which may need adding error-checking:

result=!null
for i=0,n_elements(data_str)-1 do $

result=create_struct(result,tag_names(data_str[i],/structure ),data_str[i])

Cheers, Heinz
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Orthographic projection using parametrized ellipsoid
Next Topic: TEST

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

Current Time: Wed Oct 08 07:16:25 PDT 2025

Total time taken to generate the page: 0.00456 seconds