将数字或字符串表达式转换为无符号整数(
UShort)
语法
用法
result = CUShort( numeric expression )
result = CUShort( string expression )
result = CUShort( user defined type )
参数
expression
datatype
任何数字,字符串或指针数据类型
typename
用户定义的类型
返回值
说明
CUShort函数舍入小数部分,并返回16位
UShort值。该函数不检查溢出,并且对于小于
0或大于
65535的值未定义结果。
该名称可以解释为“转换为无符号短”。
如果参数是字符串表达式,则使用
ValUInt将其转换为数字。
例子
'使用CUSHORT函数转换数值
'创建USHORT变量
Dim numeric_value As UShort
'转换数值
numeric_value = CUShort(36000.4)
'打印结果,应该返回36000
Print numeric_value
Sleep
方言差异
与QB差别
参考