Prev: Call for Paper The International Journal of Computer Science (IJCS)
Next: Which ode solver is the best for this problem? (Duffing oscillator)
From: arun on 6 Feb 2010 05:16 Hi, I would like to print a long string to the output file without any line break. The following code fragment breaks the at the middle(say between 35% - 50% of the line). Can any one suggest a remedy for this. n =100 !Fortran 90 code fragment do i=1, n write(unit2, *) trim(details(i)) end do Expecting a reply with thanks arun
From: glen herrmannsfeldt on 6 Feb 2010 06:17 arun <arunkumar.cr(a)gmail.com> wrote: > I would like to print a long string to the output file without any > line break. The following code fragment breaks the at the middle(say > between 35% - 50% of the line). Can any one suggest a remedy for > this. > n =100 !Fortran 90 code fragment > do i=1, n > write(unit2, *) trim(details(i)) > end do List directed output (the * for format) breaks lines in implementation defined ways. Use A format and it shouldn't break the line. (Unless there are implementation limits which you exceed.) > write(unit2,'(A)') trim(details(i)) -- glen
From: e p chandler on 6 Feb 2010 14:11
"glen herrmannsfeldt" <gah(a)ugcs.caltech.edu> wrote in message news:hkjj4k$se9$2(a)naig.caltech.edu... > arun <arunkumar.cr(a)gmail.com> wrote: > >> I would like to print a long string to the output file without any >> line break. The following code fragment breaks the at the middle(say >> between 35% - 50% of the line). Can any one suggest a remedy for >> this. > >> n =100 !Fortran 90 code fragment >> do i=1, n >> write(unit2, *) trim(details(i)) >> end do > > List directed output (the * for format) breaks lines in implementation > defined ways. Use A format and it shouldn't break the line. > (Unless there are implementation limits which you exceed.) > >> write(unit2,'(A)') trim(details(i)) > > -- glen write(unit2,'(A)',advance='no') trim(details(i)) or use an implied DO loop with a sufficiently large repeat count for the A format write(unit2,'(999A)') (trim(details(i)),i=1,n) -- elliot |