Leigh,

This is based on the sample from the wiki. It displays a 3x3 grid. You can put data in it and hit the Save Grid button to save the grid data as global_grid_data_base_.

----

require 'jzgrid'
cocurrent 'myform'

CELLDATA=: *./~i.3

GDEMO=: 0 : 0
pc gdemo;
xywh 0 25 200 100;cc grid isigraph rightmove bottommove;
xywh 0 0 48 12;cc SaveGrid button;cn "Save Grid";
pas 0 0;
rem form end;
)

gdemo_run=: 3 : 0
wd GDEMO
grid=: '' conew 'jzgrid'
show__grid 'celldata'
wd 'pshow'
)

create=: gdemo_run

destroy=: 3 : 0
destroy__grid''
wd 'pclose'
codestroy''
)

gdemo_close=: destroy
create''

gdemo_SaveGrid_button=: 3 : 0
global_grid_data_base_=:CELLDATA__grid
)

--
David Mitchell


Leigh J. Halliwell wrote:
Dear J Forum:

Thank you for the help with the Grid class.  However, I'm still stumped.
Can someone write up some J code that allows a user to input data via a grid
into J?  For example, set mat equal to the values that someone puts into a
3x3 grid.  Thanks.

Sincerely, Leigh -----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sherlock, Ric
Sent: Monday, September 01, 2008 3:21 AM
To: Programming forum
Subject: RE: [Jprogramming] Grid

---Leigh J. Halliwell wrote:
I've been passing data between Excel and J with the clipboard.  But I
know that J has excellent input and reporting features.  I might
use J for some spreadsheet work, if I could only understand grids.
I've looked in the labs and demos, as well as on Wiki, but they are
all to complicated or condensed.
I like the pace of the old "User Manual," but that was for Release 3.

Is there something like that for teaching me about arrays and grids?


The old User Manual was before my time but I suspect that the answer to your
question is "no".

I found the best solution for trying to understand grid, was to study
examples of use.

The demo gave me a good idea of available functionality and what some of the
options did, but I found the way it is implemented obscured how to actually
use the grid in an application.

The best simple examples of using the Grid that I know of are on this wiki
page:
<http://www.jsoftware.com/jwiki/Grid/Class>

Other examples that I found useful were the browser.ijs script in the SQLite
addon, and the csvedit addon.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to