tuple_find_last
— Return the index of the last occurrence of a tuple within another tuple.
tuple_find_last
searches backward through Tuple
for the first occurrence of the values of the second tuple
ToFind
and returns the Index
(in relation
to the first input tuple Tuple
). For example, if
Tuple
contains the values [3,4,5,6,1,2,3,4,0] and
ToFind
contains the values [3,4], the output Index
is 6. If the first tuple does not contain the second tuple as a
subtuple, tuple_find_last
returns -1 in Index
. It
is allowed to mix strings and numbers in the input tuples.
If either or both of the input tuples are empty, the operator returns an empty tuple.
HDevelop provides an in-line operation for tuple_find_last
,
which can be used in an expression in the following syntax:
Index := find_last(Tuple, ToFind)
Tuple
(input_control) tuple(-array) →
(integer / real / string)
Input tuple to examine.
ToFind
(input_control) tuple(-array) →
(integer / real / string)
Input tuple with values to find.
Index
(output_control) integer →
(integer)
Index of the last occurrence of the values to find.
tuple_find
,
tuple_find_first
,
tuple_sort
,
tuple_equal_elem
Foundation