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 #89885 is a reply to message #89884] Wed, 17 December 2014 08:49 Go to previous messageGo to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
On Wednesday, December 17, 2014 11:28:38 AM UTC+1, LC's No-Spam Newsreading account wrote:
> 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)



> For me the issue is closed (happily)
But you would have saved your time by reading the documentation more carefully.
Usage of CREATE_STRUCT is very flexible:
new_struct = CREATE_STRUCT(..., old_structure, ...)
where ... can be i) others structures, ii) tag-value pairs, iii) array of tags, array of values. In any order.

alx.
[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 15:26:35 PDT 2025

Total time taken to generate the page: 0.00477 seconds