跳到主要内容

Type.Is

确定第一个类型的值是否始终与第二个类型兼容。

Syntax

Type.Is(
type1 as type,
type2 as type
) as logical

Remarks

确定 type1 值是否始终与 type2 兼容。参数 type2 应为基元 (或可为 null 的基元) 类型值。否则,此函数的行为未定义,不应依赖。

Examples

Example #1

确定类型号的值是否始终可以视为任何类型。

Type.Is(type number, type any)

Result:

true

Example #2

确定任何类型的值是否始终可以视为类型号。

Type.Is(type any, type number)

Result:

false

Category

Type