tuple_find_firsttuple_find_firstTupleFindFirstTupleFindFirsttuple_find_first (Operator)

Name

tuple_find_firsttuple_find_firstTupleFindFirstTupleFindFirsttuple_find_first — Suchen nach dem Index des ersten gefundenen Subtupel in einem Tupel.

Signatur

tuple_find_first( : : Tuple, ToFind : Index)

Herror tuple_find_first(const Hlong Tuple, const Hlong ToFind, Hlong* Index)

Herror T_tuple_find_first(const Htuple Tuple, const Htuple ToFind, Htuple* Index)

void TupleFindFirst(const HTuple& Tuple, const HTuple& ToFind, HTuple* Index)

HTuple HTuple::TupleFindFirst(const HTuple& ToFind) const

static void HOperatorSet.TupleFindFirst(HTuple tuple, HTuple toFind, out HTuple index)

HTuple HTuple.TupleFindFirst(HTuple toFind)

def tuple_find_first(tuple: MaybeSequence[Union[int, float, str]], to_find: MaybeSequence[Union[int, float, str]]) -> int

Beschreibung

tuple_find_firsttuple_find_firstTupleFindFirstTupleFindFirstTupleFindFirsttuple_find_first durchsucht TupleTupleTupleTupletupletuple in aufsteigender Reihenfolge nach dem zweiten Tupel ToFindToFindToFindToFindtoFindto_find und gibt den entsprechenden IndexIndexIndexIndexindexindex bezüglich TupleTupleTupleTupletupletuple zurück. Beispielsweise liefert tuple_find_firsttuple_find_firstTupleFindFirstTupleFindFirstTupleFindFirsttuple_find_first für TupleTupleTupleTupletupletuple mit den Werten [3,4,5,6,1,2,3,4,0] und ToFindToFindToFindToFindtoFindto_find mit den Werten [3,4] für IndexIndexIndexIndexindexindex den Wert 0. Enthält TupleTupleTupleTupletupletuple ToFindToFindToFindToFindtoFindto_find nicht, so liefert der Operator für IndexIndexIndexIndexindexindex den Wert -1. Der Operator akzeptiert gemischte Eingabe-Tupel aus Zahlen und Strings.

Sonderfall: Leere Eingabetupel

Falls eines oder beide der Eingabetupel leer sind, gibt der Operator ein leeres Tupel zurück.

HDevelop Inline-Operation

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

Index := find_first(Tuple, ToFind)

Ausführungsinformationen

Parameter

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

Eingabetupel mit zu untersuchenden Strings.

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

Eingabetupel mit zu suchenden Werten.

IndexIndexIndexIndexindexindex (output_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Index des ersten gefundenen Subtupel in dem zu untersuchenden Tupel.

Alternativen

tuple_findtuple_findTupleFindTupleFindTupleFindtuple_find, tuple_find_lasttuple_find_lastTupleFindLastTupleFindLastTupleFindLasttuple_find_last, tuple_sorttuple_sortTupleSortTupleSortTupleSorttuple_sort, tuple_equal_elemtuple_equal_elemTupleEqualElemTupleEqualElemTupleEqualElemtuple_equal_elem

Modul

Foundation