Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!apple!sun-barr!newstop!sun!sun-bb!khb From: khb@chiba.kbierman@sun.com (Keith Bierman - SPD Advanced Languages) Newsgroups: comp.lang.fortran Subject: Re: Variable repetition count in FORMAT Message-ID: Date: 24 Jan 90 19:27:14 GMT References: <5435@blake.acs.washington.edu> Sender: news@sun.Eng.Sun.COM Distribution: na Organization: Sun Microsystems Lines: 62 In-reply-to: djo7613@blake.acs.washington.edu's message of 24 Jan 90 15:52:44 GMT In article <5435@blake.acs.washington.edu> djo7613@blake.acs.washington.edu (Dick O'Connor) writes: .... 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)) Consider the following program bork do i = 1, 10 write(*,'(x,"*")') enddo end Produces * * * * * * * * * * Sun f77v1.3. This is along the same lines as the DEC/VMS "spelling" it is certainly non-standard code. Here is a standard complying version: character*12 myform character*3 temp do 100 i = 1, 10 write(temp,'(i2)') i myform = '(' // temp // 'x,' // '''*''' // ')' write(*,myform) 100 continue end Clever use of quotation rules can be employed so this can be done with just two write statements (one internal, one external). Bottom line: Buy a VMS machine or a Sun (or anything else with this feature ... typically spelt ) or write the code to be portable, and create your format "statements" as character strings on the fly. -- Keith H. Bierman |*My thoughts are my own. !! kbierman@sun.com It's Not My Fault | MTS --Only my work belongs to Sun* I Voted for Bill & | Advanced Languages/Floating Point Group Opus | "When the going gets Weird .. the Weird turn PRO" "There is NO defense against the attack of the KILLER MICROS!" Eugene Brooks