Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!uunet!munnari.oz.au!bruce!monu0.cc.monash.edu.au!monu6!greg From: greg@monu6.cc.monash.edu.au (Greg Coldicutt) Newsgroups: comp.lang.fortran Subject: Re: Implied write loop question Message-ID: <1991Apr24.032601.5981@monu6.cc.monash.edu.au> Date: 24 Apr 91 03:26:01 GMT References: <72495@eerie.acsu.Buffalo.EDU> Organization: Caulfield Campus, Monash University, Melb., Australia. Lines: 23 In article <72495@eerie.acsu.Buffalo.EDU> v087mxgb@ubvmsa.cc.buffalo.edu writes: >In article , moshkovi@sanandreas.ecn.purdue.edu (Gennady Moshkovich) writes... >> >>I am looking for the way to print out matrix type table with >>n rows and m columns. I don't know before what n and m are. >>What is the way to print it ? >> >ummm....now if I can remember this without references.... >WRITE(*,###) ( ( X(I,J), j=1,n), I=1,m) >where, of course * is your unit number to write to >and ### is your format statement label (or lack thereof) > That will not give the correct shape (correct number of columns per line). You need a DO loop for the rows, and an implied do for columns, plus a flexible format which allows for a range of potential column numbers, eg do 200 i=1,m write(*,100) (x(i,j), j=1,n) 100 format(1x,8f10.4/(11x,7f10.4)) 200 continue (assuming Fortran printer control is required, with 80 column screen width.)