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

Home » Public Forums » archive » Re: printf formatting
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: printf formatting [message #44626 is a reply to message #44625] Thu, 30 June 2005 09:04 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"brian0918" <brian0918@gmail.com> writes:
> Alright, I found a way to do it, but it's not that pretty. I have it
> check if (the total size of the array) mod (number of columns per row)
> = 0, and if it does, then it does that command, but if it doesn't equal
> 0, then:
>
> printf,1,format='(1((1x,3(f3.1,1x)),1x,"\"),$)',data(0:*)
> printf,1," \"
>
>
> If anyone sees any problems with this, or if you know of a much easier
> way to do this, please let me know.

To avoid the comparison, couldn't you use the ':' format code to
terminate the output, and then always append the '\' with a separate
command?

Anyway, your solution doesn't seem that ugly to me. Complex
formatting requires complex solutions.

Good luck,
Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Map_Grid
Next Topic: Map_grid options

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

Current Time: Wed Oct 15 08:04:29 PDT 2025

Total time taken to generate the page: 1.92247 seconds