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

Home » Public Forums » archive » Re: Reading string array
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: Reading string array [message #11238] Thu, 19 March 1998 00:00
Alex Schuster is currently offline  Alex Schuster
Messages: 124
Registered: February 1997
Senior Member
Neil Winrow wrote:

> I have the following problem:
>
> openr,10,filnam
> dataTitle = make_array(7,/string)
> for i=1,30 do readf,10,a ;read the header information
> readf,10,dataTitle
> close,10
>
> The piece of code above is supposed to read over the header information
> in the data file, and read in the following column titles into
> dataTitle:
>
> X Y Z FLUX MAXL MAXM IMIN
>
> But this doesn't work, is there some obvious mistake I'm making with my
> code.

IDL has to know how long the individual strings are. You can use
READF, 10, dataTitle, format='(7A7)'
assuming that each string is seven characters long.

Another thing, I recomend using the GET_LUN keyword with OPEN, so you
don't have to hardcode the unit number.
OPENR, unit, filename, /GET_LUN
...
FREE_LUN, unit


Alex
--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: any Ray-Tracing lib around?
Next Topic: SAVE/RESTORE problems

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

Current Time: Wed Oct 08 17:09:08 PDT 2025

Total time taken to generate the page: 0.00909 seconds