Re: Fortran Users! Is there a better way to do this?

Ron Hudson <[email protected]>
Newsgroups gmane.comp.emulators.turnkey-mvs
Message-ID <[email protected]>
I had thoguht of that approach, but I would need six different writes and
six different format statements
and a counter to control which one to use right?  (one to advance to the
next line and 5 to print each column)

On Sat, May 15, 2010 at 1:59 PM, Dave Wade <g4ugm-/rAkYNWUBEC+PENguQupYdBc4/[email protected]>wrote:

>
>
> Rod,
>
>  From what I remember Fortran i/o is expensive so your solution is probably
> more efficient than the alternative which would be to use the "+" format
> control to allow multiple prints to occupy the same line.
>
> Dave
> G4UGM
> *Illegitimi Non Carborundum*
>
>  -----Original Message-----
> *From:* [email protected] [mailto:[email protected]] *On
> Behalf Of *Ron Hudson
> *Sent:* 15 May 2010 21:20
> *To:* [email protected]
> *Subject:* [turnkey-mvs] Fortran Users! Is there a better way to do this?
>
> Hey fellow fortran users..
>
> I have a program that produces a long list of numbers calculated one after
> the other.
> I want to print these numbers 5 wide to save 'paper'
>
> What I am doing now:
>
> an array(5)
> a pointer = 0
> loop
>    increment pointer
>    fill array(pointer) with next calculated result)
>    if pointer = 5
>        print array on a line of the page
>        zero pointer
> until done calculating
> if (pointer .ge. 1) print array(1 - pointer)
> ...
>
> Is there a better way?
>
> Ron
>
>
>   
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.