一行80文字にするために、空白文字を詰め合わせています。これでは、元の空白文字なのか、 詰め物か判別できませんし、固定長レコードにする、意味がWindowsにはありません。 行末の無駄な空白文字を書き出さないよう、lastc文字分しか書き出さないように変更しました。
c putc2.for (extended version 1) -- put sharacter on standard output
subroutine putc(c)
integer*1 c
integer*1 buf(80) ! MAXCARD(80)
integer i,lastc
data lastc/0/
if ((lastc .ge. 80) .or. (c .eq. 10)) then ! MAXCARD(80) NEWLINE(10)
write(6,100) (buf(i),i=1,lastc)
100 format(80a1) ! MAXCARD(80)
lastc = 0
endif
if (c .ne. 10) then ! NEWLINE(10)
lastc = lastc + 1
buf(lastc) = c
endif
return
end
※コメントの受付件数を超えているため、この記事にコメントすることができません。