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

Home » Public Forums » archive » Re: Command line arguments
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: Command line arguments [message #42619 is a reply to message #42530] Thu, 17 February 2005 08:23 Go to previous messageGo to previous message
Mr. No Address is currently offline  Mr. No Address
Messages: 11
Registered: February 2005
Junior Member
David Fanning wrote:
> Mr. No Address writes:
>
>
>> If I understand your first question above correctly, I'm compiling
>> first because "Way back in the day" I was never able to successfully run
>> code without compiling it first. I'm sure I was doing something wrong,
>
>
> No doubt. :-)
>
> This article might be useful to you:
>
> http://www.dfanning.com/tips/namefiles.html

It was. Thanks. In fact, self compiling worked so easily that I was
left wondering what I was doing wrong way back when. With some local
help I also have solved the Perl/IDL passing args issue that I'll
describe below for the next person.

Key words for google searches:
passing command line arguments args Perl IDL script code execute
executing system command commands

There were two problems I had. One was simply passing an argument from
within a Perl script to my IDL code. The second was getting Perl to
wait for the IDL process to finish before executing subsequent lines of
code.

Perl Code:
open(IDL, "|/usr/local/bin/idl") || die "Can't open IDL: $!";
print IDL "idlprog, \'$arg_to_pass\' \n";
print IDL "\$mv idl.ps renamed_file.ps\n";
close IDL;

The middle two print lines can be within a loop so you don't have to
open an IDL process for every iteration. I had to have the IDL process
rename the postscript file instead of doing:
`mv idl.ps renamed_file.ps`
or else Perl would zip by the first print statement and then fail to
find the idl.ps file. See
<http://archive.stsci.edu/iue/manual/dacguide/node8.html> for executing
system commands from IDL.

IDL Code:
PRO idlprog, passed_arg
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Dynamically resizing arrays
Next Topic: how to rerun subroutine only?

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

Current Time: Fri Nov 28 09:48:43 PST 2025

Total time taken to generate the page: 0.01514 seconds