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

Home » Public Forums » archive » undefining structures ?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
undefining structures ? [message #1596] Mon, 06 December 1993 10:13 Go to previous message
lucio is currently offline  lucio
Messages: 5
Registered: December 1993
Junior Member
I am trying to read in files of a priori undefined organization within IDL.

The files are "tabular" binary files (an a priori unknown number of columns
of an a priori unknown type with an a priori unknown number of rows).
"a priori unknown" means documented in a file header.

What I wish to have is a procedure myread,'myfile.name',s

which returns a structure s

This structure will have a number of members s.keyname corresponding to
keywords, and a member s.data.

The member s.data is created as: data:replicate(template,nrows)

where template is constructed building up a string containing a statement
like the following and doing an "test=execute(statement)"

template= {record,TIME:0L, THETA:0L, PHI:0L, ENERGY:0 , undef:0B}
^^^^^^

where the names and types of the tags are constructed by my procedure
according to information in the file itself. So later I can access the
individual columns as s.data.time, etc.

I MUST use a named structure, otherwise I'm getting an error "cannot have
an anonymous structure as a member of another structure").

This is fine the first time, or if I read more files with the same "record
structure", but if I try to read a file with a different structure, I get
an error % Wrong number of tags defined for structure: RECORD.

Is there any way I can REMOVE this structure from being defined (note that
it does not correspond to any true variable in use), and re-use it again ?

PS
I'm using IDL 2.2.1 (and I'm not likely to update it for the time being)

------------------------------------------------------------ -----------------
A member of G.ASS : Group for Astronomical Software Support
------------------------------------------------------------ -----------------
Lucio Chiappetti - IFCTR/CNR Milano | U N I C U I Q U E
via Bassini 15 - I-20133 Milano - Italy | System Manager
Internet: LUCIO@IFCTR.MI.CNR.IT | FORTUNAE SUAE
Decnet: IFCTR::LUCIO (39610::LUCIO) |
Bitnet: <please do not use any more> |
------------------------------------------------------------ -----------------
[Message index]
 
Read Message
Read Message
Previous Topic: Efficient IDL programming
Next Topic: Problems with dual draw widgets

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

Current Time: Fri Nov 28 09:29:32 PST 2025

Total time taken to generate the page: 0.00768 seconds