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

Home » Public Forums » archive » quirk End of file encountered before end of program
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: quirk End of file encountered before end of program [message #89884 is a reply to message #89876] Wed, 17 December 2014 02:28 Go to previous messageGo to previous message
LC's No-Spam Newsread[1] is currently offline  LC's No-Spam Newsread[1]
Messages: 8
Registered: June 2008
Junior Member
On Mon, 15 Dec 2014, Yngvar Larsen wrote:

> ! LC's No-Spam Newsreading account wrote:
>>
>> The original code I had (dating to several years ago, before anonymous
>> structures were introduced) used in fact a much more complex mechanism.
>
> Wow. Are you sure? Both named and anonymous structures have been there
> at least since IDL 4.0 (maybe even from the very beginning?), released
> several _decades_ ago.

Actually the original scripts are dated 1996 (they could be older,
possibly I wasn't using rsync to inherit things when I moved machine
before then :-)). I am a sporadic but regular IDL user ... after all IDL
was used by Giotto at the time of the last Halley comet pass (1986) ...
although I started a bit later.

> In your case, I really don't see why you cannot use
> CREATE_STRUCT(tag1, value1, tag2, value2, ...) directly.

In fact I tested it, and now do it creating a long statement and using
execute statement at the end.

> if init eq 0 then begin
> struct = create_struct(tag, value)
> init = 1
> endif else begin
> struct = create_struct(tag, value, struct)
> endelse

Hmm ... this way you are PREpending new tags ... and possibly creating a
nested structure ?

I want a sort-of flat structure where tags are APpended at the end.
I do something like this:

stmt='structure=create_struct( '

stmt=stmt+"'data', ...."

loop on "keywords"
stmt=stmt+",'"+name+"',"+value
end loop

stmt=stmt+')'
test=execute(stmt)

The first tag is special, it can be a data array or a data substructure.
All other tags come later, and are keywords read from the data file, and
assigned heuristically a data type.

So far I haven't encountered problems in building long statements
(structure with about 200 tags)

For me the issue is closed (happily)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: reading binary file with READ_BINARY
Next Topic: IDLgrPolygon question

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

Current Time: Wed Oct 08 17:27:53 PDT 2025

Total time taken to generate the page: 0.00182 seconds