Harvey,
Henry and Björn have pointed you in the right direction to solve the crux of
your problem.
Mine is a minor point.
Rather than:
numrows=. 0{$table
I would use:
numrows=. #table
A row is an "item" of a table, so #table gives the number of items in the table
and therefore the number of rows. The concept of items in J is very useful.
---Hahn, Harvey wrote:
> test=: 3 : 0
> table=. 4 3 $
> 'aaa';'aa';'a';'bbb';'bb';'b';'ccc';'cc';'c';'ddd';'dd';'d'
> numrows=. 0{$table
> for_j. (i. numrows) do.
> testfld=. < j_index NB. create arbitrary new field contents
> testfld (0{j_index)} table NB. put new contents into
> first cell in row
> end.
> )
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm