free-format printing weirdness with nested implied loop

From: Dr. Richard E. Hawkins (hawk_at_slytherin.ds.psu.edu)
Date: 06/29/04


Date: Tue, 29 Jun 2004 19:31:46 +0000 (UTC)

As I debug away, I tossed in some code that started acting strangely.
This is using Sun's Workshop.

  print *
  print "(i4,x,20(i2,x))",(i,(j,j=0,19), i=kmin,kmax)
  stop

The first line is bizarrely longer:

  -5 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

-4 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

19 -3 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

There are only 19 items in the secodn and later line, even though there
are 21 in the format string.

I must be missing something pretty obvious here . . . By the widths
used, it seems that the i4 is being ignored after the first iteration of
i.

hawk

-- 
Richard E. Hawkins, Asst. Prof. of Economics    /"\   ASCII ribbon campaign
dochawk@psu.edu  111 Hiller (814) 375-4846      \ /   against HTML mail
These opinions will not be those of              X    and postings. 
Penn State until it pays my retainer.           / \