[Jprogramming] How to tell if all boxes in a row are empty?
robert therriault
bobtherriault at mac.com
Wed Jun 1 05:23:37 UTC 2016
Based on using a: as the empty value.
[ a1=: 6#a:
┌┬┬┬┬┬┐
│││││││
└┴┴┴┴┴┘
[ a2=: a1,(<'b'),a1
┌┬┬┬┬┬┬─┬┬┬┬┬┬┐
│││││││b│││││││
└┴┴┴┴┴┴─┴┴┴┴┴┴┘
([: */ a:= ]) a1
1
([: */ a:= ]) a2
0
NB. or in explicit, since you don't like tacit
*/ a:= a1
1
*/ a:= a2
0
Cheers, bob
> On May 31, 2016, at 10:02 PM, PR PackRat <hhpackrat at gmail.com> wrote:
>
> I need to perform a certain action if an entire row in a transposed
> table (i.e., originally a column) has empty values, that is, all boxed
> data are the equivalent of a: or ''. The result should be a Boolean
> value--"true" meaning that the entire row has empty values. (A
> typical application would be old stock market data, where all of the
> "Open" values might be null or empty.)
>
> I don't know how to even begin writing such code (without a for/next
> loop to separately evaluate each box's value, a very non-J way of
> doing it). Please help. Thanks in advance!
>
>
> Harvey
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list