ClassesClasses | | Operators

tuple_is_inttuple_is_intTupleIsIntTupleIsInt (Operator)

Name

tuple_is_inttuple_is_intTupleIsIntTupleIsInt — Test if the internal representation of a tuple is of type integer.

Signature

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()

Description

tuple_is_inttuple_is_intTupleIsIntTupleIsIntTupleIsInt tests if the internal representation of the input tuple TTTTt is of type integer. In that case the value 1 (true) is returned in IsIntIsIntIsIntIsIntisInt, otherwise the value 0 (false) is returned. If a tuple consists of integer elements only, IsIntIsIntIsIntIsIntisInt can nevertheless be 0 in case the internal representation is H_TYPE_MIXED; see tuple_typetuple_typeTupleTypeTupleTypeTupleType for details.

Exception: Empty input tuple

If the input tuple is empty, the operator returns 1.

HDevelop In-line Operation

HDevelop provides an in-line operation for tuple_is_inttuple_is_intTupleIsIntTupleIsIntTupleIsInt, which can be used in an expression in the following syntax:

IsInt := is_int(T)

Attention

Even if all tuple elements are of type integer, tuple_is_inttuple_is_intTupleIsIntTupleIsIntTupleIsInt returns 0 (false) if the internal representation of the tuple is of type H_TYPE_MIXED. To test if the elements of the tuple are of type integer the operator tuple_is_int_elemtuple_is_int_elemTupleIsIntElemTupleIsIntElemTupleIsIntElem should be used.

Execution Information

Parameters

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

Input tuple.

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

Is the input tuple of type integer?

Example (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

Result

If the parameters are valid, the operator tuple_is_inttuple_is_intTupleIsIntTupleIsIntTupleIsInt returns the value 2 (H_MSG_TRUE).

Alternatives

tuple_typetuple_typeTupleTypeTupleTypeTupleType, tuple_is_numbertuple_is_numberTupleIsNumberTupleIsNumberTupleIsNumber, tuple_is_int_elemtuple_is_int_elemTupleIsIntElemTupleIsIntElemTupleIsIntElem

See also

tuple_is_realtuple_is_realTupleIsRealTupleIsRealTupleIsReal, tuple_is_stringtuple_is_stringTupleIsStringTupleIsStringTupleIsString

Module

Foundation


ClassesClasses | | Operators