Re: READF: Input conversion error. [message #91314 is a reply to message #91313] |
Mon, 29 June 2015 08:49   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Priyadarsini Sivaraj writes:
> Sry..The subject is OPENR: Expression must be a scalar or 1 element array in this context: FILENAME.
Two things are wrong. Arrays in IDL are zero-based, so array indices go
from 0 to n-1, not from 1 to n, as you have it here. And, string
concatenation happens with a plus sign. You have:
file=[filelocation,filename]
Making "file" a two-element array (when it should be a scalar). You
probably want something like this:
file = filelocation + filename
Or, perhaps this:
file = filelocaton + PathSep() + filename
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|