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

Home » Public Forums » archive » what am I doing wrong?
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: what am I doing wrong? [message #13028 is a reply to message #3602] Tue, 06 October 1998 00:00 Go to previous messageGo to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
Bruce Bowler <bbowler@bigelow.org> writes:

> William Thompson wrote:
>>
>> Bruce Bowler <bbowler@bigelow.org> writes:
>>

> (stuff deleted)

>>> if I run it as follows...
>>
>>> # idl
>>> idl> .run 6953
>>
>>> it works fine...
>>
>>> if I run it like
>>
>>> # idl 6953
>>
>>> the results are
>>
>> (stuff deleted)
>>
>>> unfortunately, because of the way I need to interact with some other
>>> stuff, I really need to run it the second way. What can I do to make it
>>> work like the first way? I don't think precompiling will work either as
>>> I generate the file "on the fly".
>>
>> If you're using Unix, then what you need to do is to create a file like the
>> following:
>>
>> #!/bin/csh
>> setenv MY_IDL_SCRIPT $argv
>> idl << done
>> .run $MY_IDL_SCRIPT
>> done
>>
>> Use "chmod +x" to make the file executable, and then you can use this to
>> execute whatever IDL script you want.

> Unfortunately, as I said before, that won't work in my case. I am
> passing this to a third party package that invokes it as

> idl xxx

> I have no control over that.

There are a couple of ways you can accomplish this. One way, as already
pointed out by Stein Vidar, is to end each line within a loop with the
characters "& $", so that IDL treats it all as one line. As I recall, this
works unless the loop is very large.

Another way is to use two procedure files. One file will contain the
main-level program that you wish to run. For example, let's say you save it in
a file called myprogram.idl. The second file will then contain the single line

.run myprogram

You can then pass the name of this second file to IDL. For example, if the
second file is named run_myprogram.pro, then the statement

idl run_myprogram

will execute the main-level procedure myprogram. It would be just the same as
if you had typed ".run myprogram" at the command prompt.

William Thompson
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Restored Object Method Compilation
Next Topic: CENTERING TEXT

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

Current Time: Fri Oct 24 23:51:47 PDT 2025

Total time taken to generate the page: 2.15819 seconds