So is this an accurate, if simplified, representation of what you want to do?

   str0=. ,&.>'A';'B';'NG';'Yow'
   col2search=. ,&.>'A';'a';'AA';'B';'BB';'C';'CC';'Foo';'Zowie';'NG'
   col2search e. str0
1 0 0 1 0 0 0 0 0 1
   str0 i. col2search   NB. Which element of "str0" found where? (4 is
not found)
0 4 4 1 4 4 4 4 4 2

The only real trick is raveling the elements of each item (,&.>) to
ensure that they are all vectors.

On Thu, Mar 29, 2012 at 4:29 PM, PackRat <pack...@anet.com> wrote:
> I wrote:
>> > That second problem was that I forgot that one cannot use "=" as a
>> > Boolean comparison verb for literals (except for single characters).
>
> and Devon McCormick responded:
>> This isn't true.
>
> I'm sorry, I used incorrect phraseology.  My intent was NOT to state
> that literals cannot be compared in a Boolean manner (i.e., a series of
> Boolean values can be generated for the various comparisons).  Of
> course, they can.  Rather, what I was thinking, but didn't clearly
> state, is that I wanted a SINGLE Boolean value (true or false) for the
> result of the entire comparison, regardless of the lengths of the two
> literals.  (In other languages, I'd be comparing strings for equality
> or identity--just a simple true/false answer to act upon.)  Hope this
> clarifies!
>
>
> Harvey
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm



-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to