88
The 1 Function: Index Generator, Index
of
OJ
Monadic (One-Argument) Form: Index Generator
18
The index generator function result
is
a vector containing
the
first B integers, start-
ing
with the index origin (see
010
system variable
in
Chapter 5). The argument can
be a nonnegative integer
that
is
either a scalar
or
a single-element array.
\5
1.
2 3
Lf.
5
A~"
\ 6
A
12~3Lf.56
~:i
+
,5
..--
Each
of
the
generated integers
is
added
to
5.
6 7 B 9 lO
Dyadic (Two-Argument) Form: Index
of
A 1 8
The
index
of
function result
is
the index
of
the
first occurrence
in
argument A
of
the
element(s) in argument
B.
Argument A must be a vector. Argument B can be
a scalar, vector, or array. The result
is
the same shape as argument
B.
If
the
element
in
argument B
cannot
be found
in
argument
A,
the value
of
the
index for
that
ele-
ment
is
one greater than
the
largest index of A (010 + pA):
2
.....
41-----------------
Second Element
3
2
6
1 9
8
1
c·
1')
\.J
.:..
9
:1.
:~
9
9 2
'ABCDEFG','C'
A
...
1
:I.
22
:33
Lf.LI·
5~5
A\22
A."9
")
.:..
8
B 2
t)
Lf.
B~"2
3pl
9 8
1
C'
,J
B
A\S
B
2
Note: The result of the 1 function depends on
the
010
system variable (see Chapter
5 for information on
the
010 system variable).