tuple_first_ntuple_first_nTupleFirstNTupleFirstN (Operator)

Name

tuple_first_ntuple_first_nTupleFirstNTupleFirstN — Auswählen der vorderen Elemente eines Tupels bis zum Index „n“.

Signatur

tuple_first_n( : : Tuple, Index : Selected)

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

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

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

HTuple HTuple::TupleFirstN(const HTuple& Index) const

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

HTuple HTuple.TupleFirstN(HTuple index)

Beschreibung

tuple_first_ntuple_first_nTupleFirstNTupleFirstNTupleFirstN wählt die vorderen Elemente des Tupels TupleTupleTupleTupletuple bis zum Index IndexIndexIndexIndexindex aus und liefert sie in dem Ausgabetupel SelectedSelectedSelectedSelectedselected zurück. Der Index eines Tupelelements wird beginnend mit 0 gezählt, das heißt, das erste Tupelelement wird über den Index 0 ausgewählt. Insgesamt werden also IndexIndexIndexIndexindex+1 Elemente zurückgeliefert.

IndexIndexIndexIndexindex muss eine ganze Zahl sein (oder eine Gleitkommazahl, deren Nachkommastellen 0 sind).

Sonderfall: Leeres Eingabetupel

Falls TupleTupleTupleTupletuple leer ist, wird eine Fehlermeldung angezeigt.

HDevelop Inline-Operation

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

Selected := firstn(Tuple, Index)

Ausführungsinformationen

Parameter

TupleTupleTupleTupletuple (input_control)  tuple(-array) HTupleHTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

Eingabetupel.

IndexIndexIndexIndexindex (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Index des letzten auszuwählenden Elements.

SelectedSelectedSelectedSelectedselected (output_control)  tuple(-array) HTupleHTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

Ausgewählte Tupelelemente.

Alternativen

tuple_last_ntuple_last_nTupleLastNTupleLastNTupleLastN, tuple_selecttuple_selectTupleSelectTupleSelectTupleSelect, tuple_str_bit_selecttuple_str_bit_selectTupleStrBitSelectTupleStrBitSelectTupleStrBitSelect, tuple_concattuple_concatTupleConcatTupleConcatTupleConcat, tuple_select_masktuple_select_maskTupleSelectMaskTupleSelectMaskTupleSelectMask

Siehe auch

tuple_removetuple_removeTupleRemoveTupleRemoveTupleRemove

Modul

Foundation