vb6 - 为什么long l = 1000 * 60会导致溢出?

标签 vb6

我有这一行:

    Dim l&
    l = 1000 * 60 '1 min

它会引发溢出错误。

这是为什么?

最佳答案

Vb 的帮助说:

You attempt to use a number in a calculation, and that number is coerced into an integer, but the result is larger than an integer. For example:

Dim x As Long
x = 2000 * 365   ' Error: Overflow

To work around this situation, type the number, like this:

Dim x As Long
x = CLng(2000) * 365

关于vb6 - 为什么long l = 1000 * 60会导致溢出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75117202/

相关文章:

c# - 将 DateAdd 和 Format 代码从 VB6 转换为 C#

animation - 如何在VB6中流畅地制作这个角色的动画

vb6 - 有没有办法在 VB6/Visual Studio 6.0 IDE 中显示行号?

vb6 - 如何将源代码放入 VB6 的子文件夹中?

c# - 从 C# dll 库读取 VB6 项目的 app.config

.net - 从 VB6.0 升级的最佳开发工具

sql-server - VB6 ADODB.Recordset RecordCount 属性总是返回 -1

visual-studio - 有没有人在 Windows 7 上使用 Visual Studio 6 取得成功?

winforms - VB6 列表框复制

vb6 - 没有表单激活的自定义 MsgBox 被触发