Re: Another user input question [message #67347] |
Wed, 15 July 2009 11:40 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Joanna writes:
> I'm writing a program where I want the user to input which file they
> want to be read into the program. I previously had a specific file in
> the program using rdfloat, where I knew how many columns there were,
> etc. Now I want my program to be more universal, but I'm having
> trouble figuring out how to allow the user to pick the file. I've
> tried things like this:
>
> data=' '
> read,'Enter file',x
> data=rd_tfile( or other such functions), 'data'... and so on and so
> forth...
> print,data
>
> I just keep getting various types of error messages. Any ideas?
Try this:
file = Dialog_Pickfile()
IF file EQ "" THEN RETURN
There are various keywords you can use with DIALOG_PICKFILE
to refine your search. Learn about them by typing this:
IDL> ? dialog_pickfile
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|