table =. (cleanfield&.> 0{"1 table) (<a:;0)} table

Henry Rich 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Hahn, Harvey
> Sent: Thursday, July 31, 2008 11:26 AM
> To: Programming forum
> Subject: RE: [Jprogramming] Amending within a For loop
> 
> Henry Rich wrote:
> |The loop could be replaced by
> |table =. (<"0 i. #table) (<a:;0)} table
> 
> Thanks for all your help!
> 
> You suggested that the loop could be replaced by a "loopless"
> single-line version.  Does your suggestion apply only to my posted
> "simplified" version?  The "real" version's loop (now 
> incorporating your
> solution) looks more like this, where "cleanfield" is an explicit
> definition for doing some cleanup work (for testing purposes,
> "cleanfield" definition contents of something like  'xxx',y  works
> fine):
> 
> for_j. (i. numrows) do.
>   isbnfld=. <cleanfield >0{j_index{table   NB. get and modify 
> ISBN cell
> contents
>   table=. isbnfld (<j_index,0)} table      NB. replace ISBN cell
> contents in table
> end.
> 
> Is this complication of including a called function still amenable in
> some way to your single-line suggestion above?  It would sure be great
> if it could.  Thanks!
> 
> Harvey
> ----------------------------------------------------------------------
> 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