tuple_last_ntuple_last_nTupleLastNTupleLastNtuple_last_n (Operator)
Name
tuple_last_ntuple_last_nTupleLastNTupleLastNtuple_last_n
— Select all elements from index “n” to the end of a tuple.
Signature
def tuple_last_n(tuple: MaybeSequence[Union[float, int, str]], index: int) -> Sequence[Union[float, int, str]]
def tuple_last_n_s(tuple: MaybeSequence[Union[float, int, str]], index: int) -> Union[float, int, str]
Description
Starting with the “n-th” element of the tuple TupleTupleTupletupletuple
,
tuple_last_ntuple_last_nTupleLastNTupleLastNtuple_last_n
selects every element of TupleTupleTupletupletuple
and returns
it with SelectedSelectedSelectedselectedselected
. Thus, SelectedSelectedSelectedselectedselected
contains all
elements of TupleTupleTupletupletuple
from index “n” up to the last element
of TupleTupleTupletupletuple
(including the element at position “n”). The index
“n” is determined by the input parameter IndexIndexIndexindexindex
. Thus,
IndexIndexIndexindexindex
must contain a single integer value (if IndexIndexIndexindexindex
consists of a floating point number, this must represent
an integer value without fraction). Indices of tuple elements start at 0,
that means, the first tuple element has got the index 0.
Exception: Empty input tuple
If TupleTupleTupletupletuple
is empty, an exception is raised.
HDevelop In-line Operation
HDevelop provides an in-line operation for tuple_last_ntuple_last_nTupleLastNTupleLastNtuple_last_n
,
which can be used in an expression in the following syntax:
Selected := lastn(Tuple, Index)
Execution Information
- Multithreading type: independent (runs in parallel even with exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
TupleTupleTupletupletuple
(input_control) tuple(-array) →
HTupleMaybeSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
Input tuple.
IndexIndexIndexindexindex
(input_control) integer →
HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Index of the first element to select.
SelectedSelectedSelectedselectedselected
(output_control) tuple(-array) →
HTupleSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
Selected tuple elements.
Alternatives
tuple_first_ntuple_first_nTupleFirstNTupleFirstNtuple_first_n
,
tuple_selecttuple_selectTupleSelectTupleSelecttuple_select
,
tuple_str_bit_selecttuple_str_bit_selectTupleStrBitSelectTupleStrBitSelecttuple_str_bit_select
,
tuple_concattuple_concatTupleConcatTupleConcattuple_concat
,
tuple_select_masktuple_select_maskTupleSelectMaskTupleSelectMasktuple_select_mask
See also
tuple_removetuple_removeTupleRemoveTupleRemovetuple_remove
Module
Foundation