Please see "select." and "case.".  The default of the select, when no options 
match is any "case." without a value before the "do.".

See http://www.jsoftware.com/help/dictionary/csel.htm


> f1=: 3 : 0
>  select. y
>   case. 'a' do. i.1
>   case. 'b' do. i.2
>   case.     do. i.3
>  end.
> )
> 
>    f1&.> 'a' ; ('a';'b') ; 'b' ; 'x'
> +-+-+---+-----+
> |0|0|0 1|0 1 2|
> +-+-+---+-----+

-- 
Alan

On May 21, 2010, at 11:48 AM, Sprague, Webb (OFM) wrote:

> Let me rephrase -- Could somebody who knows J better than I confirm that
> there is NO way to specify a default in a control structure, or if there
> is, enlighten me on how to do it?
> 
>> -----Original Message-----
>> From: [email protected] [mailto:programming-
>> [email protected]] On Behalf Of Brian Schott
>> Sent: Friday, May 21, 2010 11:45 AM
>> To: Programming forum
>> Subject: Re: [Jprogramming] Default in control structure?
>> 
>> From the .ijx window check out the Help|Control Structures menu.
>> 
>> On Fri, May 21, 2010 at 2:32 PM, Sprague, Webb (OFM)
>> <[email protected]> wrote:
>>> Hi all,
>>> 
>>> Does J have a conditional control structure such that 1 of N
> options,
>> with a way to specify a default if none of the conditions are met?
>>> 
>> ----------------------------------------------------------------------
>> 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

Reply via email to