apl>" <-APL2-------------------- sam206.txt ---------------------------->
apl>" <---------------------------display------------------------------->
apl>)read cap2/help/display.txt
apl>Lfx file
display
apl>Gdisplay[L]G
G d#s display a;Lio ;r;c;hl;hc;ht;hb;vl;vb;v;w;n;b
[1] " display a general array in pictorial form
[2] " normal call is monadic. dyadic call used only in
[3] " recursion to specify display rank, shape, and depth
[4] Lio #0
[5] C(0=Lnc 's')/'s#Ra'
[6] r#YR,s" pseudo rank.
[7] c#'++++'" ur, ul, ll, and lr corners.
[8] hl#'-'" horizontal line.
[9] hc#hl,'@$',hl,'~+E'" horizontal borders.
[10] ht#hc[(0<r)X1+0<Y-1Y,s]
[11] "w#,0`=`1Y0R`Z(1SRa)Ya
[12] " this expression will produce 1 if all items
[13] " in variable a are numeric, or will fail with
[14] " a domain error otherwise.
[15] " a 1 if 0 items in a, otherwise count of
[16] " a items in a.
[17] " a b
[18] " a bbbbbb
[19] " aaaaaaaaaaaaaaaaa
[20] hb#hc[3+3D('2X~a`=Fa'Lea '1+YE0X(1SX/Ra)Y,a')+3X1<RRs]
[21] vl#'|'" vertical line.
[22] vb#vl,'OU'" vertical border.
[23] v#vb[(1<r)X1+0<-1Y-1U,s]
[24] C(0ERa)/'a#(1SRa)R`ZYa'" show prototype of empties
[25] $(1<`=a)/gen
[26] $(2<RRa)/d3
[27] d#Fa" simple arrays
[28] w#1YRd#(-2Y1 1,Rd)Rd
[29] n#-1+1URd
[30] $(0=RRa)/ss
[31] d#(c[1],v,((w_1)Rvl),c[2]),((ht,nRhl),[0]d,[0]hb,nRhl),c[0],(wRvl),c[3]
[32] $0
[33] ss:hb#((0 ' ')=Y0R`Za)/' -'
[34] d#' ',(' ',[0]d,[0]hb,nR' '),' '
[35] $0
[36] gen:d#Fdisplay`1a" enclosed ...
[37] n#dV.^=' '
[38] d#(nV~1`On)`/d
[39] d#(V`/~' '`Ed)/d
[40] d#((1,Rs)Rs)display d
[41] $(2ZR,s)Ud3e,0
[42] d3:d#0 -1U0 1UF`Za" multi-dimensional
[43] w#1YRd
[44] n#-1+1URd
[45] d#(c[1],v,((w_1)Rvl),c[2]),((ht,nRhl),[0]d,[0]hb,nRhl),c[0],(wRvl),c[3]
[46] d3e:n#-2+R,s
[47] v#c[nR1],[0]vb[1+0<-2U,s],[0](((-3+YRd),n)Rvl),[0]c[nR2]
[48] d#v,d
[49] " copied from IBM's tryapl2 workspace
G
apl>"tHdisplay#I1YRLcr 'display'
apl>display 23
23
apl>display 1 2
+$--+
|1 2|
+~--+
apl>display 2 3RI6
+$----+
U1 2 3|
|4 5 6|
+~----+
apl>display 1 2 'more' (3 'a') (2 2RI4) 'b'
+$---------------------------+
| +$---+ +$----+ +$--+ |
| 1 2 |more| | 3 a | U1 2| b |
| +----+ ++----+ |3 4| - |
| +~--+ |
+E---------------------------+
apl>display 1 2 'more' (3 'or') (2 2RI4) 'b'
+$------------------------------+
| +$---+ +$-------+ +$--+ |
| 1 2 |more| | +$-+ | U1 2| b |
| +----+ | 3 |or| | |3 4| - |
| | +--+ | +~--+ |
| +E-------+ |
+E------------------------------+
apl>display `Z `Z 1 2
+-----------+
| +-------+ |
| | +$--+ | |
| | |1 2| | |
| | +~--+ | |
| +E------+ |
+E----------+
apl>)off