Useful Apl Statements And User-Defined Functions - IBM 5110 User Manual

Apl
Table of Contents

Advertisement

USEFUL APL STATEMENTS AND USER-DEFINED FUNCTIONS
To remove duplicate blanks from a character vector:
VCOM
P
I~ESS
I::
[]:I V
V Z
~"CDM
P
I~ESB
W;
I
I:
:l
::I
Z
l. .,. ( ( :L
<I>
I )
X I
~
..
W::::'
') /
W
E.. '.
"
l,,1
V
C(]MPI~ESB
· AAA
AAA BBBB
eee IfDD
BBBB
eee
nnD'
The right argument is the character vector.
To create a matrix from a character vector with a delimiter for each
row:
VFD
RM
I::
[]:1
V
. / 010 will b~ set to ~ just d~ring
' V
Mf-D
FORM S; A;
F.t;
X;
Z;
!JID / '
the execution of this function.
[1J
[]IOf-O
[2J
Mf-(Xf-S~D)/Sf.}S
1:3J
Zf.(X¢l'X,N-:ltX)/l+\PX
[~]
Mf-«pA),B)p(,(A-l)D,~\Bf-Orr/A~X[Z-lJ/Z-O/-l'Z)\M
V
'D' FORM 'ADBDCCCDD'
A
' -
13
~
eee
In this example, the .) character is used
D
as the delimiter. The left argument specifies
the delimiter, and the right argument
specifies the character vector.
APL Language Elements
31

Advertisement

Table of Contents
loading

Table of Contents