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

Home » Public Forums » archive » Re: A very simple FORMAT question
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: A very simple FORMAT question [message #39079] Sat, 24 April 2004 04:26 Go to previous message
Christopher Lee is currently offline  Christopher Lee
Messages: 4
Registered: February 2001
Junior Member
> Any explanation for these extra brackets? (for IDL, ifc, ...)
>
> Cheers,
>
> A.

The answer to this lies with our old friend Google....

http://www.hef.kun.nl/~pfk/teaching/fortran/ftn-AB.html

"The rule for rescanning formats is complicated by the presence of
brackets surrounding groups of format codes. The full rule for rescan is
as follows. If there are no nested brackets, rescan returns to the
beginning of the format. Otherwise, the rescan returns to the left bracket
which matches the right bracket nearest to the closing bracket of the
format. If this left bracket is preceded by a repeat count, this count
takes effect during the rescan."

so...

print, findgen(6),format='(i," A",i," B",i," C")'
0 A 1 B 2 C
3 A 4 B 5 C

print, findgen(6),format='(i," A",(i," B"),i," C")'
0 A 1 B 2 C
3 B 4 C
5 B

If you want the read to include the terms before the first _real_
brackets in a repeat, you need an extra set of opening brackets.

Chris.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: simplify a polyline?
Next Topic: Newbie needs help getting mpi_plot going

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

Current Time: Wed Oct 08 19:17:51 PDT 2025

Total time taken to generate the page: 0.00464 seconds