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

Home » Public Forums » archive » Opening variable files
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: Opening variable files [message #8049 is a reply to message #7951] Thu, 30 January 1997 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Chris Crabtree" <cecrabtr@artsci.wustl.edu> writes:

> I am currently trying to write a widget based application
> and I ran into a problem. I want the user to be able to open a file of
> his or her choosing, but when I try to use the statement
>
> openr, 1, filename
>
> where filename is a string (variable) I get a message saying that a scalar
> value is expected. Is there any way to allow the user to enter in the new
> file name without exiting the application and recompiling the program with
> the new 'filename' inserted.

Chris, you probably got this filename from a text widget. When you
get the value of a text widget, you always are returned a string
*array*, even if there is only one "thing" in your text widget.

You can make your program work by typing this:

openr, 1, filename(0)

But this is lousy code. :-)

I'd use this:

OPENR, lun, filename(0), /GET_LUN

This will save you some headaches down the road debugging
your programs. Tell your advisor you need a copy of "Building
Graphical User Interfaces in IDL", too. You can get it from RSI.

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
2642 Bradbury Court, Fort Collins, CO 80521
Phone: 970-221-0438 Fax: 970-221-4762
E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
-----------------------------------------------------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: surface plots with color shading
Next Topic: Angstrom symbol?

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

Current Time: Sun Nov 30 13:52:16 PST 2025

Total time taken to generate the page: 0.63809 seconds