VBS基础篇-----数据类型之间的转换
Value Description
Byte Byte value
decimal是整数数据类型
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。