Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!uakari.primate.wisc.edu!caesar.cs.montana.edu!ogicse!blake!djo7613 From: djo7613@blake.acs.washington.edu (Dick O'Connor) Newsgroups: comp.lang.fortran Subject: Variable repetition count in FORMAT Keywords: FORMAT, repetition count Message-ID: <5435@blake.acs.washington.edu> Date: 24 Jan 90 15:52:44 GMT Distribution: na Organization: Univ of Washington, Seattle Lines: 30 Somewhere in my youth (or childhood!) I recall working on a (CDC?) FORTRAN compiler that allowed you to pass an integer variable in a READ or WRITE statement to the FORMAT statement to enable a variable number of repetitions of a particular descriptor. I think the equals sign was used on the FORMAT end, so that ICOUNT=4 WRITE (41,900) ICOUNT, (IARRAY(I),I=1,ICOUNT) 900 FORMAT (=(I5)) would act as if the FORMAT statement read 900 FORMAT (4(I5)) Now in this case, it's trivial, because FORMAT will do what you want anyway, without any special repetition count. In The Real World, I have a case where the FORMAT statement is complicated, writes different alpha descriptions on each line, followed by the rep count and ICOUNT many real numbers, where ICOUNT is actually an array of integer variables, not all the same. That equals sign (if I recall the character used correctly) would come in handy, but my current environment doesn't support it. I can clever my way around the problem with a bit more code, but it got me wondering...is this construct I recall a legal bit of FORTRAN in any current implementations? Is this all just a bad dream? :) "Moby" Dick O'Connor ** DISCLAIMER: It would Washington Department of Fisheries ** surprise me if the Olympia, Washington 98504 ** rest of the Department Internet Mail: djo7613@blake.u.washington.edu ** agreed with any of this!