VBS基础篇-----数据类型之间的转换

ValueDescription

Byte

Byte value

Integer

Integer value

Long

Long integer value

Single

Single-precision floating-point value

Double

Double-precision floating-point value

Currency

Currency value

Decimal

Decimal value

Date

Date or time value

String

Character string value

Boolean

Boolean value; True or False

Empty

Uninitialized

Null

No valid data

<object type>

Actual type name of an object

Object

Generic object

Unknown

Unknown object type

Nothing

Object variable that doesn't yet refer to an object instance

Error

Error

 以上可以在QTP帮助文档中找到

关于类型转换:

Cbool

变量转换成布尔值

Cbyte

变量转换为0到255之间的整数

Ccur、Cdbl、Csng

变量转换为浮点数值,前者精确到小数点后四位,后两者要更加精确,范围大的多

Cdate

变量转换为日期值

Cint、Clng

变量转换为整数,后者的范围比前者要大的多

Cstr

变量转换为字符串

 判断一个变量是否是数字:

 IsNumeric(expression)如果expression是数字和数字字符串则返回 TRUE,否则返回 FALSE。

原文地址:https://www.cnblogs.com/tongcy/p/4568192.html