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

Home » Public Forums » archive » 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 #62641 is a reply to message #42537] Mon, 29 September 2008 11:32 Go to previous messageGo to previous message
xiao zhang is currently offline  xiao zhang
Messages: 81
Registered: June 2008
Member
On Sep 29, 11:41 am, Spon <christoph.b...@gmail.com> wrote:
> On Sep 29, 5:01 pm, xiao <littledd...@gmail.com> wrote:
>
>
>
>> HI~ guys , is these lines right? Why I cannot open the file based on
>> the following errors. I know the file is there :(   Thank you
>
>> filename=command_line_args()
>> print,filename
>> file='filename'
>> OPENR, lun, file, /GET_LUN
>>   rows = File_Lines(file)
>> header = STRARR(14)
>> READF, lun, header
>>  PRINT, header
>>   Point_Lun, -lun, currentLocation
>
>> Or like this?
>
>> filename=command_line_args()
>> print,filename
>> OPENR, lun, 'filename', /GET_LUN
>>   rows = File_Lines('filename')
>> header = STRARR(14)
>> READF, lun, header
>>  PRINT, header
>>   Point_Lun, -lun, currentLocation
>
> What exactly are the errors you mention you're getting?
>
> Also, what do you get when you type this?
>
> filename=command_line_args(count=count)
> help, filename
> print, transpose(filename)
> print, 'Count:', Count
>
> What are you using the following line for?
>
> file='filename'
>
> If you want to extract the first string from the string array returned
> by the command_line_args() function, I would use
> file = filename[0]
> instead.
>
> Apart from that - as it stands, I would say that yes, these lines are
> probably right in that I can't find an obvious coding error there, but
> it depends on what you're trying to do!
>
> Tell us more :-)
> Chris

I did it like this :

idl -arg D20051210_220601_P.QC.eol

And then

IDL> .r upperdata.pro
% Compiled module: $MAIN$.
D20051210_220601_P.QC.eol
% OPENR: Error opening file. Unit: 100, File: filename
No such file or directory

It can print the right name but did not open the file......
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL Workbench Printing Woes
Next Topic: Re: Newbie math trouble

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

Current Time: Thu Oct 09 21:57:55 PDT 2025

Total time taken to generate the page: 0.79959 seconds