Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!mips!apple!olivea!genie!udel!rochester!rocksanne!jeyadev From: jeyadev@rocksanne.uucp (Surendar Jeyadev) Newsgroups: comp.lang.fortran Subject: Re: Implied do loop in write (SUMMARY) Message-ID: <788@rocksanne.WRC.XEROX.COM> Date: 24 Apr 91 22:44:24 GMT References: <1991Apr23.201123.3908@unixg.ubc.ca> <13617@ur-cc.UUCP> Sender: news@WRC.XEROX.COM Reply-To: jeyadev@sita.UUCP (Surendar Jeyadev) Organization: Xerox Corporation, Webster Research Center Lines: 28 In article <13617@ur-cc.UUCP> rbr4@uhura.cc.rochester.edu (Roland Roberts) writes: >Depending on what you mean by ``nice,'' there are easier ways that >using a subroutine call. The technique I have often used (both on IBM >VS Fortran and DEC Fortran) is to take advantage of the format >statement having an implied loop, i.e., the last grouping is repeated >until there is no data. For example: > > do 1 i = 1,n > write(6,100) (matrix(i,j),j=1,m) > 1 continue > 100 format(1x,10i8,:/,(11x,10i8,:/)) > >On both VS Fortran and DEC Fortran, the `:' says ...... If one is using VAX Fortran, why not use do 1 i = 1,n write(6,'((3x,i8)') (matrix(i,j),j=1,m) 1 continue I have found the useful. VAX and Sun Fortran allow a variable to be used, but you have to enclose it in angled brackets. -- Surendar Jeyadev Internet: jeyadev.wbst128@xerox.com Most books say that the sun is a star. But, somehow, it knows how to change back to a sun in the morning. (5th grader)