[Jprogramming] Formatting then Boxing a vector
Alex Rufon
alex_rufon at ist-systems.com
Tue Jul 1 14:27:06 HKT 2008
Oh.
I actually didn't understand why it was throwing a length error. I just
assumed (erroneously) that since the statement worked on one item ...
adding an each should work. Thanks for the heads-up. I'll keep this in
mind in the future.
-----Original Message-----
From: programming-bounces at jsoftware.com
[mailto:programming-bounces at jsoftware.com] On Behalf Of Henry Rich
Sent: Friday, June 27, 2008 9:40 PM
To: 'Programming forum'
Subject: RE: [Jprogramming] Formatting then Boxing a vector
The problem with your original 'each' was that you
needed to box x:
(<'r<0>2.0') (8!:2) each A
Henry Rich
> -----Original Message-----
> From: programming-bounces at jsoftware.com
> [mailto:programming-bounces at jsoftware.com] On Behalf Of Alex Rufon
> Sent: Friday, June 27, 2008 5:49 AM
> To: programming at jsoftware.com
> Subject: [Jprogramming] Formatting then Boxing a vector
>
> Hi.
>
> I have no excuse but I couldn't seem to get this to work. I'm
> currently
> applying a learning curve to a production plan and I encountered this
> problem.
>
> I have a list of numbers:
> A=: 6 7 8 9 10 11 12 13
>
> I need to convert them to a formatted boxed string like this:
> +--+--+--+--+--+--+--+--+
> |06|07|08|09|10|11|12|13|
> +--+--+--+--+--+--+--+--+
>
> I know I can do it this way:
> < 'r<0>2.0' (8!:2) 6
> +--+
> |06|
> +--+
>
> When get the wrong results when I try to do it this way:
> < 'r<0>2.0' (8!:2) A
> +----------------+
> |0607080910111213|
> +----------------+
>
> 'r<0>2.0' (8!:2) each A
> |length error
> | 'r<0>2.0' (8!:2)each A
>
> 'r<0>2.0' (8!:2) box every A
> 0607080910111213
>
> 'r<0>2.0' (8!:2) each box every A
> |length error
> | 'r<0>2.0' (8!:2)each box every A
>
> Of course I could just use a for_xyz. Loop and be done with it but its
> irking me that I can't seem to make it work.
>
> Thanks for the help.
>
> r/Alex
> ----------------------------------------------------------------------
> For information about J forums see
> http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list