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 #89875 is a reply to message #89868] Mon, 15 December 2014 03:42 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 Fri, 12 Dec 2014, alx wrote:
> LC's No-Spam Newsreading account wrote:
>> On Thu, 11 Dec 2014, Jim P wrote:
>>
>>>> The code should look something like this
>>>>
>>>> pro xxx.pro,ARGUMENTS
>>>> openw,2,'temporary.temp'
>>>> printf,2,'structure=create_struct( $'
>>>> CASE STATEMENT FILLING THE STRUCTURE DEFINITION in the temp file
>>>> printf,2,')'
>>>> close,2
>>>> ; and instantiate it
>>>> @ temporary.temp
>>>> return
>>>> end
>>
>>> I suspect this isn't behaving as you wish it to behave, due to a
>>> misinterpretation of how "@" is used.
>>>
>>> The "@" in your code is interpreted at compile time, not at run time.
>>
>> I did not realize that.
>>
>> The original code I had (dating to several years ago, before anonymous
>> structures were introduced) used in fact a much more complex mechanism.

and even had a comment I wrote saying what Jim says 4 lines above !

>> Is there any limitation to the string length in execute(string) ?
>>
>> I used a temporary file because the structure definition is rather long,
>> and is constructed in steps (driven from a data file) ... for legibility
>> temporary.temp has the statement on several lines (terminated by the $
>> continuation marker but last one)
>>
>> If there is no limitation I could concatenate the pieces of the
>> statement instead of writing them to temporary.temp and just execute the
>> resulting string.

Apparently I tried that, and did not encounter any problem with at least
about 200 structure elements.

> if you do not want to initialize your structure directly in the main
> procedure (by x = {...}), you could create an external function

Sorry ALX this comment is out of scope. I may or may not do it in the
main procedure or in a second level function (actually the original
code did both for two different cases).

My point was about building the structure definition at runtime
(essentially, the structure tag names are driven by the data file being
read)
[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:28:16 PDT 2025

Total time taken to generate the page: 0.00443 seconds