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

Home » Public Forums » archive » Re: Return the name of the last (newest) file ?
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: Return the name of the last (newest) file ? [message #31670 is a reply to message #31669] Tue, 13 August 2002 11:53 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning (david@dfanning.com) writes:
>
> It's telling you the variable is an array, and it should
> be a scalar. It happens to be an array with only one element
> in it, however, so use it like this:
>
> data=read_ascii(lastfile[0],data_start=1)

Whoops, sorry. I hit that SEND button before I meant to.
I was going to tell you that it is not uncommon to get
arrays back from string routines, and often arrays of
a single element. This probably has to do with how
strings are stored internally in routines, but it's
mostly lazy programming, it seems to me. In *your* programs,
you are going to do something like this:

IF N_Elements(returnString) EQ 1 THEN RETURN, returnString[0] ELSE $
RETURN, returnString

Then your user won't have to worry about this perfectly
true, but less than illuminating error message. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Scrolling in draw widgets - newbie's question
Next Topic: Return the name of the last (newest) file ?

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

Current Time: Wed Oct 08 19:02:13 PDT 2025

Total time taken to generate the page: 0.00466 seconds