tuple_selecttuple_selectTupleSelectTupleSelecttuple_select (Operator)

Name

tuple_selecttuple_selectTupleSelectTupleSelecttuple_select — Auswählen einzelner Elemente aus einem Tupel.

Signatur

tuple_select( : : Tuple, Index : Selected)

Herror tuple_select(const Hlong Tuple, const Hlong Index, Hlong* Selected)

Herror T_tuple_select(const Htuple Tuple, const Htuple Index, Htuple* Selected)

void TupleSelect(const HTuple& Tuple, const HTuple& Index, HTuple* Selected)

HTuple HTuple::TupleSelect(const HTuple& Index) const

static void HOperatorSet.TupleSelect(HTuple tuple, HTuple index, out HTuple selected)

HTuple HTuple.TupleSelect(HTuple index)

def tuple_select(tuple: MaybeSequence[Union[float, int, str]], index: MaybeSequence[int]) -> Sequence[Union[float, int, str]]

def tuple_select_s(tuple: MaybeSequence[Union[float, int, str]], index: MaybeSequence[int]) -> Union[float, int, str]

Beschreibung

tuple_selecttuple_selectTupleSelectTupleSelectTupleSelecttuple_select wählt einzelne Elemente aus einem Tupel TupleTupleTupleTupletupletuple aus und liefert sie über den Parameter SelectedSelectedSelectedSelectedselectedselected zurück. Der Parameter IndexIndexIndexIndexindexindex gibt hierbei einen oder mehrere Indizes an, über die festgelegt wird, welche Elemente ausgewählt werden. Folgerichtig darf IndexIndexIndexIndexindexindex ausschließlich ganze Zahlen beinhalten (falls IndexIndexIndexIndexindexindex eine Gleitkommazahl enthält, so muss diese eine ganze Zahl repräsentieren; alle Nachkommastellen der Zahl müssen also 0 sein). Tupelindizes werden beginnend mit 0 gezählt, das heißt, das erste Tupelelement wird über den Index 0 ausgewählt.

Sonderfall: Leeres Eingabetupel

Falls TupleTupleTupleTupletupletuple leer ist, wird eine Fehlermeldung angezeigt.

HDevelop Inline-Operation

HDevelop unterstützt eine Inline-Operation für tuple_selecttuple_selectTupleSelectTupleSelectTupleSelecttuple_select, die innerhalb eines Ausdrucks in der folgenden Syntax verwendet werden kann:

Selected := Tuple[Index]

Selected := subset(Tuple, Index)

Ausführungsinformationen

Parameter

TupleTupleTupleTupletupletuple (input_control)  tuple(-array) HTupleMaybeSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

Eingabetupel.

IndexIndexIndexIndexindexindex (input_control)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indizes der auszuwählenden Elemente.

SelectedSelectedSelectedSelectedselectedselected (output_control)  tuple(-array) HTupleSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

Ausgewähltes Tupelelement.

Alternativen

tuple_first_ntuple_first_nTupleFirstNTupleFirstNTupleFirstNtuple_first_n, tuple_last_ntuple_last_nTupleLastNTupleLastNTupleLastNtuple_last_n, tuple_str_bit_selecttuple_str_bit_selectTupleStrBitSelectTupleStrBitSelectTupleStrBitSelecttuple_str_bit_select, tuple_concattuple_concatTupleConcatTupleConcatTupleConcattuple_concat, tuple_select_rangetuple_select_rangeTupleSelectRangeTupleSelectRangeTupleSelectRangetuple_select_range, tuple_select_ranktuple_select_rankTupleSelectRankTupleSelectRankTupleSelectRanktuple_select_rank

Siehe auch

tuple_removetuple_removeTupleRemoveTupleRemoveTupleRemovetuple_remove

Modul

Foundation