---Leigh J. Halliwell wrote: > 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. >
You might find this previous forum thread interesting. <http://www.jsoftware.com/pipermail/programming/2008-June/010958.html> Are you wanting to use this facility interactively in the session or as part of a user interface? If the answer is interactively below is a script that I was working on to extend the grid verb to provide an editgrid verb. It still doesn't return the contents on close, but assigns the grid to the noun CELLDATA_ED in the locale that editgrid was called. E.g. editgrid 3 5 NB. Edit the numbers in the grid NB. Close the grid NB. Inspect CELLDATA_ED ================================================= script_z_ '~system/classes/grid/jzgrid.ijs' coclass 'jegrid' coinsert 'jzgrid' gridpdestroy=: 3 : 0 CELLDATA_ED__locD=. CELLDATA__grid wd 'pclose' destroy__grid'' codestroy'' ) egridp=: 4 : 0 a=. conew 'jegrid' x gridpshow__a y ) editgrid_z_=: 3 : 0 (0 0$0) editgrid y : opts=. x,,:'CELLEDIT';1 (opts;coname'') egridp_jegrid_ y ) =================================================== ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
