f0=. 3 : 'echo ''this''[y'"0
f1=. 3 : 'echo ''that''[y'"0
f2=. 3 : 'echo ''etc''[y'"0

   f0`f1`f2 @.]"0]i.3
this
that
etc

On Fri, Feb 14, 2020 at 4:58 PM PMA <[email protected]> wrote:

> Ahhhhhhhhh, beautiful, thank you!!!
>
> On 02/14/2020 04:33 PM, Julian Fondren wrote:
> >    TEST =: 3 : 0
> >      for_NAME. y do.
> >        select. NAME
> >        case. 0 do. echo 'this'
> >        case. 1 do. echo 'that'
> >        case. do. echo 'etc'
> >        end.
> >      end.
> >    )
> >
> > as used:
> >
> >       TEST i.3
> >    this
> >    that
> >    etc
> >
> > That's the second 'for' at
> > https://code.jsoftware.com/wiki/Vocabulary/fordot
> >
> > On 2020-02-14 15:25, PMA wrote:
> >> Hi J Gurus,
> >>
> >> Please forgive an awfully naive question.
> >> Here it is in sorta-J context --
> >>
> >> TEST =: 3 : 0
> >>   For each item (an integer) in y
> >>   do.
> >>     How can I NAME the item, in order to
> >>     select. NAME and then run
> >>       case. 0 do. this
> >>       case. 1 do. that, etc., against it?
> >>     end.
> >>   end.
> >> )
> >>
> >> Thanks in advance,
> >> Pete
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


-- 

Devon McCormick, CFA

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

Reply via email to