ClassesClasses | | Operators

tuple_is_stringtuple_is_stringTupleIsStringTupleIsString (Operator)

Name

tuple_is_stringtuple_is_stringTupleIsStringTupleIsString — Test if the internal representation of a tuple is of type string.

Signature

tuple_is_string( : : T : IsString)

Herror tuple_is_string(const char* T, Hlong* IsString)

Herror T_tuple_is_string(const Htuple T, Htuple* IsString)

void TupleIsString(const HTuple& T, HTuple* IsString)

HTuple HTuple::TupleIsString() const

static void HOperatorSet.TupleIsString(HTuple t, out HTuple isString)

HTuple HTuple.TupleIsString()

Description

tuple_is_stringtuple_is_stringTupleIsStringTupleIsStringTupleIsString tests if the internal representation of the input tuple TTTTt is of type string. In that case the value 1 (true) is returned in IsStringIsStringIsStringIsStringisString, otherwise the value 0 (false) is returned. If a tuple consists of string elements only, IsStringIsStringIsStringIsStringisString 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_stringtuple_is_stringTupleIsStringTupleIsStringTupleIsString, which can be used in an expression in the following syntax:

IsString := is_string(T)

Attention

Even if all tuple elements are of type string, tuple_is_stringtuple_is_stringTupleIsStringTupleIsStringTupleIsString 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 string the operator tuple_is_string_elemtuple_is_string_elemTupleIsStringElemTupleIsStringElemTupleIsStringElem should be used.

Execution Information

Parameters

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

Input tuple.

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

Is the input tuple of type string?

Example (HDevelop)

tuple_is_string ([3.1416,'pi',3], IsStringA)
* IsStringA = false
tuple_is_string (['a','b','111'], IsStringB)
* IsStringB = true
tuple_is_string ([], IsStringC)
* IsStringC = true

Result

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

Alternatives

tuple_typetuple_typeTupleTypeTupleTypeTupleType, tuple_is_numbertuple_is_numberTupleIsNumberTupleIsNumberTupleIsNumber, tuple_is_string_elemtuple_is_string_elemTupleIsStringElemTupleIsStringElemTupleIsStringElem

See also

tuple_is_inttuple_is_intTupleIsIntTupleIsIntTupleIsInt, tuple_is_realtuple_is_realTupleIsRealTupleIsRealTupleIsReal

Module

Foundation


ClassesClasses | | Operators