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 #89892 is a reply to message #89884] Wed, 17 December 2014 23:57 Go to previous message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
On Wednesday, 17 December 2014 11:28:38 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.

Old indeed! But in 1996, anonymous structures were definitely there. I started using IDL around that time myself.

Automatic structure definition via CREATE_STRUCT(name=mystruct) or {mystruct}, using a file mystruct__define.pro came later, I think.

>> 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 ...

struct = create_struct(struct, tag, value)

> and possibly creating a nested structure ?

No nesting here, unless one of your VALUEs happen to be a structure.

> For me the issue is closed (happily)

Good for you. However, I will strongly advise to always reconsider your approach whenever you feel you need to use EXECUTE. This is almost always a sign that you are doing it wrong, or at least reinventing some of IDLs wheels.

--
Yngvar
[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 19:00:04 PDT 2025

Total time taken to generate the page: 0.00433 seconds