IBM 5110 User Manual page 38

Apl
Table of Contents

Advertisement

To merge two variables with the same shape into a single vector:
VMEI~GE[[]]V
V
Zf·A
MEI~GE
B
[1]
Z~,A/[OIO-O.5J
B
V
A~~.~
2~)'
A'
Bf·2
2~)'B'
A
MEI~GE
B
AAAABBBE«
To delete duplicate elements in a vector:
VDUPLICATEI::[lJV
'f,1
Z~"DUPLICATE
V
[lJ
Z~«\PV)=V\V)/V~,V
V
DUPLICATE 1 2 3 3 4 2 5 6 5 5
1 2 3 ' + 5 6
To find the first nonblank character in a character vector:
VNONBI...ANKI::OJV
V
Z~"N()NBL..ANK
W
[:l.J
Z~"1
t
(W¢'
• )/W
V
V~"
DAN'
NONBI...ANI(
V
D
VNONBI...ANK X
I:: []
J
V
V
Z~NONBLANKX
W
I::L]
Z~
.. (
<\~J;{:'
· )/W
V
NDNBI...ANKX
V
D
APL Language Elements
33

Advertisement

Table of Contents
loading

Table of Contents