The point is, a test block can have multiple lines (perhaps even containing if. blocks!) and the result of the LAST line is the result of the test.
Here, everything between select. and case. is the test block. Henry Rich > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of bill lam > Sent: Sunday, February 24, 2008 9:18 PM > To: Programming forum > Subject: Re: [Jprogramming] Beg Q--what am I doing wrong in > this select/case? > > I can reproduce the error, it seems that your debugging code > cause side effect, > try this > select6 =: 3 : 0 NB. seek numeric match > opID =: 6 > select. opID > wdinfo 'val:'; opID > wdinfo 'shape:'; ($opID) > wdinfo 'datatype:'; (3!:0 opID) > opID > case. 1;2;3 do. > wdinfo 'case 1,2,3'; opID > case. 4;5;6 do. > wdinfo 'case 4,5,6'; opID > case. do. > wdinfo 'no case match'; '' > end. > ) > > or > > select6 =: 3 : 0 NB. seek numeric match > opID =: 6 > wdinfo 'val:'; opID > wdinfo 'shape:'; ($opID) > wdinfo 'datatype:'; (3!:0 opID) > select. opID > case. 1;2;3 do. > wdinfo 'case 1,2,3'; opID > case. 4;5;6 do. > wdinfo 'case 4,5,6'; opID > case. do. > wdinfo 'no case match'; '' > end. > ) > > J library 'strings' provide many verbs for trimming, on your > ijx session, type > open 'strings' > to learn what is available. > > regards, > bill > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
