J question: box as an output formatter, or other paths to formatted output? 
Author Message
 J question: box as an output formatter, or other paths to formatted output?

Hi,

I'm exploring using J instead of a spread sheet for some small
financial calculations.  While I welcome comments on the advisability
of this tack, for the moment take it as a given.

What I'd really like is the ability to use the boxing facility in J to
lay out the elements (numeric and/or text).  Then I'd like to get rid
(w.r.t. display) the boxing perimeter.

I went back to the boxed display section of Hui's "Implementation of
J" and redefined bcorn,tcorn,bint,tint to white space and that worked
OK, but this doesn't effect the native box command <, just the now
changed "thbox" verb.

So my questions are:
        a) is there a convenient way to strip off the perimeters of J's native box command?
        b) are there other elegant ways to achieve formatted output ?

Oh, I'm using  J7.

thanks,
Ira Ekhaus

PS. here is an example of a boxed output, where I'd  like to remove the perimeters.

l=.'indirect_g_a';'payroll_taxes ';'health_insurance';'retirement ';'training';'indirect_travel ';'state_tax '; 'bank_fees ';'shipping';'office_insurance'
|:l,:<"1 (  8.2":"0 (]+%)20?100)
+----------------+--------+
|indirect_g_a    |   47.02|
+----------------+--------+
|payroll_taxes   |   13.08|
+----------------+--------+
|health_insurance|   70.01|
+----------------+--------+
|retirement      |   12.08|
+----------------+--------+
|training        |   39.03|
+----------------+--------+
|indirect_travel |   58.02|
+----------------+--------+
|state_tax       |   17.06|
+----------------+--------+
|bank_fees       |   44.02|
+----------------+--------+
|shipping        |    5.20|
+----------------+--------+
|office_insurance|   52.02|
+----------------+--------+
|patent          |   37.03|
+----------------+--------+
|legal           |   22.05|
+----------------+--------+
|office_supplies |   10.10|
+----------------+--------+
|lab_supplies    |   57.02|
+----------------+--------+
|depreciation    |   69.01|
+----------------+--------+
|prof_services   |   21.05|
+----------------+--------+
|interest        |   23.04|
+----------------+--------+
|contributions   |   87.01|
+----------------+--------+
|advertising     |   76.01|
+----------------+--------+
|life_insurance  |   83.01|
+----------------+--------+



Sat, 07 Mar 1998 03:00:00 GMT  
 J question: box as an output formatter, or other paths to formatted output?

Quote:

>Hi,

>I'm exploring using J instead of a spread sheet for some small
>financial calculations.  While I welcome comments on the advisability
>of this tack, for the moment take it as a given.

>What I'd really like is the ability to use the boxing facility in J to
>lay out the elements (numeric and/or text).  Then I'd like to get rid
>(w.r.t. display) the boxing perimeter.

>I went back to the boxed display section of Hui's "Implementation of
>J" and redefined bcorn,tcorn,bint,tint to white space and that worked
>OK, but this doesn't effect the native box command <, just the now
>changed "thbox" verb.

>So my questions are:
>    a) is there a convenient way to strip off the perimeters of J's native box command?
>    b) are there other elegant ways to achieve formatted output ?

>Oh, I'm using  J7.

>thanks,
>Ira Ekhaus


 I'm not positive they exist in J7, but you should see if   9!:6
and  9!:7  work there.   These verbs query and set the box drawing
characters used.  Eg:
   2;3
+-+-+
|2|3|
+-+-+
   9!:6 ''    NB. Query boxdraw
+++++++++|-
   9!:7 ]11$' '   NB. Set boxdraw to all blanks

   2;3

 2 3

--



Sat, 07 Mar 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. [QUESTION] Output Formatter

2. Changing an output box in a case structure to an input box

3. output format question

4. Another output format question ...

5. Compiling legacy fortran code under MS Fortran Powerstation - output format question

6. Output/Input formatting question (FORTRAN 70)

7. Beginner Question - Formatting output

8. Formatted Output Question

9. Formatted output question

10. clock format -format %H output incorrect

11. formatter output to list

12. how print output to screen and output file

 

 
Powered by phpBB® Forum Software