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

Home » Public Forums » archive » Re: OPENing a file with variable name?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: OPENing a file with variable name? [message #4860] Fri, 18 August 1995 00:00
Pat Pfeifer is currently offline  Pat Pfeifer
Messages: 2
Registered: August 1995
Junior Member
>> Hi. I am trying to open a file whose name is a variable using OPEN. The
>> code looks like this
>> OPENR,1,filename
>> where filename is a string. I checked...it is definitely a string. Could
>> someone please tell me how to open a file using a variable for the file name?

I had the same problem, so here is a portion of the code I wrote to
get around it:

fname = pickfile (Path=!dir)

;Make sure they picked a filename
fname2 = string(fname, /print) ;Some vars aren't string constants
if strlen (fname2) gt 1 then begin
;Open the file and read the data
openr, lun, fname2 , /Get_lun
endif
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Another PVWAVE widget question
Next Topic: Re: Please HELP!!!!!

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

Current Time: Sun Oct 12 04:30:06 PDT 2025

Total time taken to generate the page: 1.20166 seconds