Format Code Question [message #35691] |
Tue, 01 July 2003 09:00  |
MC
Messages: 50 Registered: September 1996
|
Member |
|
|
Will any one know the code to cause PRINTF to advance to a new page for
output to file?
Can't find it in the documentation.
Thanks in advance,
MC
|
|
|
Re: Format code question [message #61396 is a reply to message #35691] |
Wed, 16 July 2008 05:30  |
Bruce Bowler
Messages: 128 Registered: September 1998
|
Senior Member |
|
|
On Wed, 16 Jul 2008 05:09:00 -0700, lbnc wrote:
> Hi there,
>
> to me, the format code '(I03,",",I03,",",I03)' is the same as
> '(I03,2(",",I03))'. Not, it seems, to IDL:
>
> aa = indgen(2, 3)
> str_aa = string(aa, format='(I03,",",I03,",",I03)') print, str_aa
> str_aa = string(aa, format='(I03,2(",",I03))') print, str_aa
> end
>
> gives here on my machine
>
> 000,001,002 003,004,005
> 000,001,002 ,003,004 ,005,
>
> Anybody knows why? Bug or feature?
>
> Cheers
> Lasse Clausen
"feature" IDL uses the FORTRAN idiom for format statements which says
essential that if there is a "repeat count group" that's as far back as we
go when we need to re-use elements in the format statement. It's sort of
documented in the help files.
Bruce
|
|
|
Re: Format code question [message #61398 is a reply to message #35691] |
Wed, 16 July 2008 05:19  |
lbnc
Messages: 15 Registered: January 2005
|
Junior Member |
|
|
On 16 Jul, 13:09, l...@lbnc.de wrote:
> Hi there,
>
> to me, the format code '(I03,",",I03,",",I03)' is the same as
> '(I03,2(",",I03))'. Not, it seems, to IDL:
>
> aa = indgen(2, 3)
> str_aa = string(aa, format='(I03,",",I03,",",I03)')
> print, str_aa
> str_aa = string(aa, format='(I03,2(",",I03))')
> print, str_aa
> end
>
> gives here on my machine
>
> 000,001,002 003,004,005
> 000,001,002 ,003,004 ,005,
>
> Anybody knows why? Bug or feature?
>
> Cheers
> Lasse Clausen
Just in case you are wondering, this produces the same odd behaviour
for
aa = indgen(3, 2)
Cheers
Lasse Clausen
|
|
|