tuple_find_lasttuple_find_lastTupleFindLastTupleFindLasttuple_find_last (Operator)

Name

tuple_find_lasttuple_find_lastTupleFindLastTupleFindLasttuple_find_last — Suchen nach dem Index des letzten gefundenen Subtupel in einem Tupel.

Signatur

tuple_find_last( : : Tuple, ToFind : Index)

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

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

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

HTuple HTuple::TupleFindLast(const HTuple& ToFind) const

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

HTuple HTuple.TupleFindLast(HTuple toFind)

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

Beschreibung

tuple_find_lasttuple_find_lastTupleFindLastTupleFindLastTupleFindLasttuple_find_last durchsucht TupleTupleTupleTupletupletuple rückwärts, d.h. in absteigender Reihenfolge, nach der ersten Übereinstimmung mit den Werten des zweiten Tupels ToFindToFindToFindToFindtoFindto_find und gibt den entsprechenden IndexIndexIndexIndexindexindex bezüglich TupleTupleTupleTupletupletuple zurück. Beispielsweise liefert tuple_find_lasttuple_find_lastTupleFindLastTupleFindLastTupleFindLasttuple_find_last 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 6. 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_lasttuple_find_lastTupleFindLastTupleFindLastTupleFindLasttuple_find_last, die innerhalb eines Ausdrucks in der folgenden Syntax verwendet werden kann:

Index := find_last(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 letzten gefundenen Subtupel in dem zu untersuchenden Tupel.

Alternativen

tuple_findtuple_findTupleFindTupleFindTupleFindtuple_find, tuple_find_firsttuple_find_firstTupleFindFirstTupleFindFirstTupleFindFirsttuple_find_first, tuple_sorttuple_sortTupleSortTupleSortTupleSorttuple_sort, tuple_equal_elemtuple_equal_elemTupleEqualElemTupleEqualElemTupleEqualElemtuple_equal_elem

Modul

Foundation