tuple_is_inttuple_is_intTupleIsIntTupleIsInt (Operator)

Name

tuple_is_inttuple_is_intTupleIsIntTupleIsInt — Testen, ob die interne Repräsentation eines Tupels vom Typ integer (Ganzzahl) ist.

Signatur

tuple_is_int( : : T : IsInt)

Herror tuple_is_int(const Hlong T, Hlong* IsInt)

Herror T_tuple_is_int(const Htuple T, Htuple* IsInt)

void TupleIsInt(const HTuple& T, HTuple* IsInt)

HTuple HTuple::TupleIsInt() const

static void HOperatorSet.TupleIsInt(HTuple t, out HTuple isInt)

HTuple HTuple.TupleIsInt()

Beschreibung

tuple_is_inttuple_is_intTupleIsIntTupleIsIntTupleIsInt testet, ob die interne Repräsentation des Eingabetupels TTTTt vom Typ integer (Ganzzahl) ist. In diesem Fall wird 1 (true) zurückgegeben, ansonsten wird 0 (false) zurückgegeben. Falls ein Tupel nur aus Elementen des Typs integer besteht, kann IsIntIsIntIsIntIsIntisInt trotzdem gleich 0 sein, falls die interne Repräsentation des Tupels H_TYPE_MIXED ist; siehe tuple_typetuple_typeTupleTypeTupleTypeTupleType für weitere Details.

Sonderfall: Leeres Eingabetupel

Falls das Eingabetupel leer ist, gibt der Operator 1 zurück.

HDevelop Inline-Operation

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

IsInt := is_int(T)

Achtung

Auch falls alle Elemente des Tupels vom Typ integer sind, liefert tuple_is_inttuple_is_intTupleIsIntTupleIsIntTupleIsInt 0 (false) zurück, falls die interne Repräsentation des Tupels vom Typ H_TYPE_MIXED ist. Um zu testen, ob die Elemente des Tupels vom Typ integer sind, sollte der Operator tuple_is_int_elemtuple_is_int_elemTupleIsIntElemTupleIsIntElemTupleIsIntElem verwendet werden.

Ausführungsinformationen

Parameter

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

Eingabetupel.

IsIntIsIntIsIntIsIntisInt (output_control)  number HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Ist das Eingabetupel vom Typ integer (Ganzzahl)?

Beispiel (HDevelop)

tuple_is_int ([3.1416,'pi',3], IsIntA)
* IsIntA = false
tuple_is_int ([1,2,3], IsIntB)
* IsIntB = true
tuple_is_int ([], IsIntC)
* IsIntC = true

Ergebnis

Sind die Parameterwerte korrekt, dann liefert tuple_is_inttuple_is_intTupleIsIntTupleIsIntTupleIsInt den Wert 2 (H_MSG_TRUE).

Alternativen

tuple_typetuple_typeTupleTypeTupleTypeTupleType, tuple_is_numbertuple_is_numberTupleIsNumberTupleIsNumberTupleIsNumber, tuple_is_int_elemtuple_is_int_elemTupleIsIntElemTupleIsIntElemTupleIsIntElem

Siehe auch

tuple_is_realtuple_is_realTupleIsRealTupleIsRealTupleIsReal, tuple_is_stringtuple_is_stringTupleIsStringTupleIsStringTupleIsString, tuple_is_handletuple_is_handleTupleIsHandleTupleIsHandleTupleIsHandle

Modul

Foundation