tuple_select_masktuple_select_maskTupleSelectMaskTupleSelectMask (Operator)
Name
tuple_select_masktuple_select_maskTupleSelectMaskTupleSelectMask
— Select in mask specified elements of a tuple.
Signature
Description
tuple_select_masktuple_select_maskTupleSelectMaskTupleSelectMaskTupleSelectMask
selects one or more single elements of the tuple
TupleTupleTupleTupletuple
and returns them with SelectedSelectedSelectedSelectedselected
. For every element
MaskMaskMaskMaskmask
determines the corresponding element to select.
If the value is greater than 0, the appropriate element is selected.
Thus the length of the two input tuples has to be equal and
MaskMaskMaskMaskmask
may only contain integer or float values.
Exception: Empty input tuples
If both input tuples are empty, the operator returns an
empty tuple. If only one of the input tuples is empty and the other is not,
an exception is raised.
HDevelop In-line Operation
HDevelop provides an in-line operation for tuple_select_masktuple_select_maskTupleSelectMaskTupleSelectMaskTupleSelectMask
,
which can be used in an expression in the following syntax:
Selected := select_mask(Tuple, Mask)
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) →
HTupleHTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
Input tuple.
MaskMaskMaskMaskmask
(input_control) integer(-array) →
HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
> 0 specifies the elements to select.
SelectedSelectedSelectedSelectedselected
(output_control) tuple(-array) →
HTupleHTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
Selected tuple elements.
Alternatives
tuple_first_ntuple_first_nTupleFirstNTupleFirstNTupleFirstN
,
tuple_last_ntuple_last_nTupleLastNTupleLastNTupleLastN
,
tuple_str_bit_selecttuple_str_bit_selectTupleStrBitSelectTupleStrBitSelectTupleStrBitSelect
,
tuple_concattuple_concatTupleConcatTupleConcatTupleConcat
,
tuple_selecttuple_selectTupleSelectTupleSelectTupleSelect
,
tuple_select_rangetuple_select_rangeTupleSelectRangeTupleSelectRangeTupleSelectRange
,
tuple_select_ranktuple_select_rankTupleSelectRankTupleSelectRankTupleSelectRank
See also
tuple_removetuple_removeTupleRemoveTupleRemoveTupleRemove
Module
Foundation