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

Gary Lee Phillips <[email protected]>
Newsgroups gmane.comp.emulators.turnkey-mvs
Message-ID <[email protected]>
>The writing is easy:
>write(6,100) (array(i), i = 1,5)
>100 format (' ',5I12)

>Then I empty the array and fill it again to print the next line. I was
>hoping to do it without the array and indexes and stuff.

I think you need the array if you're worried about I/O efficiency. If
you want to write a whole page at once with just one I/O, you can.
Just make the array bigger. Say you want 50 lines of 5 values each,
dimension the array(250) and try this:

      WRITE(6,100) (ARRAY(I), I = 1, 250)
100 FORMAT ('1 ', 50(/1X,5I12))

Obviously, if there aren't going to be 250 values, you need to adjust
somehow for that. In general, though, one I/O per line just isn't that
big a deal these days, so what you are already doing is pretty
acceptable.

--Gary
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.