tuple_is_mixedtuple_is_mixedTupleIsMixedTupleIsMixedtuple_is_mixed (算子)
名称
tuple_is_mixedtuple_is_mixedTupleIsMixedTupleIsMixedtuple_is_mixed — Test whether a tuple is of type mixed.
签名
Herror tuple_is_mixed(const char* T, Hlong* IsMixed)
Herror T_tuple_is_mixed(const Htuple T, Htuple* IsMixed)
def tuple_is_mixed(t: HTupleType) -> int
描述
tuple_is_mixedtuple_is_mixedTupleIsMixedTupleIsMixedTupleIsMixedtuple_is_mixed tests the input tuple TTTTtt.
If the type is mixed, the value 1 (true) is returned in
IsMixedIsMixedIsMixedIsMixedisMixedis_mixed, else 0 (false) is returned. If a tuple consists of
elements with equal data types only, IsMixedIsMixedIsMixedIsMixedisMixedis_mixed can nevertheless be 1
in case the internal representation is H_TYPE_MIXED; see
tuple_typetuple_typeTupleTypeTupleTypeTupleTypetuple_type for details.
If the type of the tuple is mixed and you need all elements of
the tuple TTTTtt to be of one data type only, you can
explicitly convert the tuple to a better fitting
representation by using tuple_inttuple_intTupleIntTupleIntTupleInttuple_int, tuple_realtuple_realTupleRealTupleRealTupleRealtuple_real or
tuple_stringtuple_stringTupleStringTupleStringTupleStringtuple_string with Format='s'. This improves processing speed for the
converted tuple which is especially useful if the tuple is used many times
afterwards.
例外:空输入元组
If the input tuple is empty, the operator returns 1.
HDevelop 内联操作
HDevelop provides an in-line operation for tuple_is_mixedtuple_is_mixedTupleIsMixedTupleIsMixedTupleIsMixedtuple_is_mixed,
which can be used in an expression in the following syntax:
IsMixed := is_mixed(T)
执行信息
- 多线程类型:独立(即使使用独占算子也能并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
TTTTtt (输入控制) tuple(-array) → HTupleHTupleTypeHTupleHtuple (string / real / integer / handle) (string / double / int / long / HHandle) (HString / double / Hlong / HHandle) (char* / double / Hlong / handle)
Input tuple.
IsMixedIsMixedIsMixedIsMixedisMixedis_mixed (输出控制) number → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Is the input tuple of type mixed?
示例(HDevelop)
tuple_is_mixed ([3.1416,'pi',3], IsMixedA)
* IsMixedA = true
tuple_is_mixed (['a','b','111'], IsMixedB)
* IsMixedB = false
tuple_is_mixed ([], IsMixedC)
* IsMixedC = true
结果
如果参数有效,算子
tuple_is_mixedtuple_is_mixedTupleIsMixedTupleIsMixedTupleIsMixedtuple_is_mixed 返回值 2 ( H_MSG_TRUE )。
替代
tuple_typetuple_typeTupleTypeTupleTypeTupleTypetuple_type,
tuple_is_numbertuple_is_numberTupleIsNumberTupleIsNumberTupleIsNumbertuple_is_number
另见
tuple_is_inttuple_is_intTupleIsIntTupleIsIntTupleIsInttuple_is_int,
tuple_is_realtuple_is_realTupleIsRealTupleIsRealTupleIsRealtuple_is_real
模块
基础