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

Home » Public Forums » archive » read a file written in fortran
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: read a file written in fortran [message #71303 is a reply to message #71186] Tue, 08 June 2010 16:33 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
bing999 wrote:
> For information, here is how i wrote the file in fortran:
>
> write(my_unit,'(9e14.6,L1)') a,b,c,d,e,f,g,h,i,my_logical
>
> Then, how to read a L1 format in IDL?

; Define true/false explicitly
FALSE = 0
TRUE = 1

; Read the file
tmp = ""
readf, your_unit, format='(9e14.6,a1)', a,b,c,d,e,f,g,h,i,tmp

; Process the logical
case strupcase(tmp) of
'T': my_logical=TRUE
'F': my_logical=FALSE
ELSE: message,'invalid logical!'
endcase


??
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Coyote Graphics Update 30 Jan 2011
Next Topic: Re: Y2 axis title orientation

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

Current Time: Wed Oct 08 17:47:06 PDT 2025

Total time taken to generate the page: 0.00575 seconds