CLngInt
 
将数字或字符串表达式转换为64位整数(LongInt

语法

Declare Function CLngInt ( ByVal expression As datatype ) As LongInt

Type typename
End Type

用法

result = CLngInt( numeric expression )
result = CLngInt( string expression )
result = CLngInt( user defined type )

参数

expression
要转换为LongInt值的数字,字符串或指针表达式
datatype
任何数字,字符串或指针数据类型
typename
用户定义的类型

返回值

这个 LongInt值。

说明

CLngInt函数舍入小数部分,并返回64位LongInt值。该函数不检查溢出,并且对于小于223372036854775808或大于223372036854775807#.

The name can be explained as 'Convert to LoNG INTeger'.

If the argument is a string expression, it is converted to numeric by using
ValLng.

例子

'使用CLNGINT函数转换数值

'创建一个LONG INTEGER变量
Dim numeric_value As LongInt

'转换数值
numeric_value = CLngInt(-12345678.123)

'打印结果,应该返回-12345678
Print numeric_value
Sleep


方言差异

  • -lang qb 方言中不可用,除非使用别名__Clngint引用。

与QB差别

  • 新的FreeBASIC

参考