tuple_findtuple_findTupleFindTupleFind (Operator)

Name

tuple_findtuple_findTupleFindTupleFind — Suchen eines Tupels in einem anderem Tupel und Rückgabe der Indizes.

Signatur

tuple_find( : : Tuple, ToFind : Indices)

Herror tuple_find(const Hlong Tuple, const Hlong ToFind, Hlong* Indices)

Herror T_tuple_find(const Htuple Tuple, const Htuple ToFind, Htuple* Indices)

void TupleFind(const HTuple& Tuple, const HTuple& ToFind, HTuple* Indices)

HTuple HTuple::TupleFind(const HTuple& ToFind) const

static void HOperatorSet.TupleFind(HTuple tuple, HTuple toFind, out HTuple indices)

HTuple HTuple.TupleFind(HTuple toFind)

Beschreibung

tuple_findtuple_findTupleFindTupleFindTupleFind sucht im Eingabetupel TupleTupleTupleTupletuple in aufsteigender Reihenfolge das zweite Eingabetupel ToFindToFindToFindToFindtoFind und liefert als Resultat die Indizes der gefundenen Subtupel (bezogen auf das Eingabetupel TupleTupleTupleTupletuple) in dem Ergebnistupel IndicesIndicesIndicesIndicesindices zurück. Besteht TupleTupleTupleTupletuple zum Beispiel aus den Werten [3,4,5,6,1,2,3,4,0] und enthält ToFindToFindToFindToFindtoFind die beiden Werte [3,4], so beinhaltet das Ausgabetupel IndicesIndicesIndicesIndicesindices die Ergebniswerte [0,6]. Falls im ersten Eingabetupel TupleTupleTupleTupletuple das zweite Eingabetupel ToFindToFindToFindToFindtoFind nicht enthalten ist, so wird -1 im Ergebnistupel IndicesIndicesIndicesIndicesindices zurückgegeben. Die Eingabetupel dürfen Strings und Zahlen auch gemischt enthalten.

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_findtuple_findTupleFindTupleFindTupleFind, die innerhalb eines Ausdrucks in der folgenden Syntax verwendet werden kann:

Indices := find(Tuple, ToFind)

Ausführungsinformationen

Parameter

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

Eingabetupel mit zu untersuchenden Strings.

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

Eingabetupel mit zu suchenden Werten.

IndicesIndicesIndicesIndicesindices (output_control)  integer(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indizes der gefundenen Subtupel in dem zu untersuchenden Tupel.

Alternativen

tuple_find_firsttuple_find_firstTupleFindFirstTupleFindFirstTupleFindFirst, tuple_find_lasttuple_find_lastTupleFindLastTupleFindLastTupleFindLast, tuple_sorttuple_sortTupleSortTupleSortTupleSort, tuple_inversetuple_inverseTupleInverseTupleInverseTupleInverse, tuple_equal_elemtuple_equal_elemTupleEqualElemTupleEqualElemTupleEqualElem

Modul

Foundation