Hahn, Harvey wrote:
> Ric Sherlock wrote:
> |Not sure if the above is a typo, but in case it is not - the
> |left argument to the grid verb should be a boxed 2-column
> |matrix/table (if it is not a 2-column matrix, then the verb
> |expects the left argument to be header labels for the header
> |rows and columns). The first column should contain the option
> |name, the 2nd column the option value.
> | (,:'NAME1';value1 ) grid data
> | (('NAME1';value1),('NAME2';value2),:'NAME3';value3 ) grid data
>
> It wasn't a typo, and that's why I wish there were more examples for
> things. I was taking a stab at the syntax. For virtually everybody
> here, I'm sure the above is a "second nature" kind of pattern (just as
> in spoken languages). I know what a boxed 2-column name/value matrix
> would look like, but I don't necessarily know the complete pattern for
> *creating* one out of the blue--and I didn't have time to spend to try
> 101 variations before I hit the winning move. Admittedly, trial and
> error is one way of learning (and having the learning "stick" with you).
> On the other hand, as a former teacher, I also know that it is extremely
> inefficient; that's why we have schools and education in general, so
> that we don't have to reinvent the wheel all the time but can build on
> previously learned (albeit, sometimes indirect) knowledge. Any
> instruction in spoken languages depends upon learning *patterns* in the
> language, and that's how I learn from the patterns I see in the code
> examples people give here.
>
> |It might also be an improvement to add the Year labels as
> |column headers using HDRCOL and HDRCOLMERGE instead of
> |including them in the data grid.
>
> The way I coded it is the traditional "it's always been done that way"
> approach (that is, for at least the past 45-50 years, if not more).
> Thus, it's the user expectation.
The Grid package is a class that supports drawing a grid on a form.
The grid verb is a cover function that uses this to draw simple grids.
Many more simple cover functions could be written, including one to
support your own preferred style.
I suggest you start by looking at the options in the Grid package,
http://www.jsoftware.com/jwiki/Grid/Options . Does one of these do what
you want? If so, can it be set in grid? If not, can you describe or
program exactly what is needed?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm