tuple_last_ntuple_last_nTupleLastNTupleLastNtuple_last_n (Operator)

Name

tuple_last_ntuple_last_nTupleLastNTupleLastNtuple_last_n — Auswählen aller Elemente ab Index „n“ bis um Ende eines Tupels.

Signatur

tuple_last_n( : : Tuple, Index : Selected)

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

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

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

HTuple HTuple::TupleLastN(const HTuple& Index) const

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

HTuple HTuple.TupleLastN(HTuple index)

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]

Beschreibung

tuple_last_ntuple_last_nTupleLastNTupleLastNTupleLastNtuple_last_n wählt die hinteren Elemente des Tupels TupleTupleTupleTupletupletuple aus und liefert sie in dem Ausgabetupel SelectedSelectedSelectedSelectedselectedselected zurück. SelectedSelectedSelectedSelectedselectedselected enthält dann alle Elemente des Tupels TupleTupleTupleTupletupletuple ab dem „n-ten“ Element (inklusive des „n-ten“ Elements). Der Index „n“ wird durch den Parameter IndexIndexIndexIndexindexindex festgelegt. Folgerichtig muss IndexIndexIndexIndexindexindex eine ganze Zahl beinhalten (falls IndexIndexIndexIndexindexindex eine Gleitkommazahl enthält, so muss diese eine ganze Zahl repräsentieren; alle Nachkommastellen der Zahl müssen also 0 sein). Der Index eines Tupelelements wird 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_last_ntuple_last_nTupleLastNTupleLastNTupleLastNtuple_last_n, die innerhalb eines Ausdrucks in der folgenden Syntax verwendet werden kann:

Selected := lastn(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 HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Index des ersten auszuwählenden Elements.

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ählte Tupelelemente.

Alternativen

tuple_first_ntuple_first_nTupleFirstNTupleFirstNTupleFirstNtuple_first_n, tuple_selecttuple_selectTupleSelectTupleSelectTupleSelecttuple_select, tuple_str_bit_selecttuple_str_bit_selectTupleStrBitSelectTupleStrBitSelectTupleStrBitSelecttuple_str_bit_select, tuple_concattuple_concatTupleConcatTupleConcatTupleConcattuple_concat, tuple_select_masktuple_select_maskTupleSelectMaskTupleSelectMaskTupleSelectMasktuple_select_mask

Siehe auch

tuple_removetuple_removeTupleRemoveTupleRemoveTupleRemovetuple_remove

Modul

Foundation