运行时错误“6":Visual Basic

编程入门 行业动态 更新时间:2024-10-28 14:26:08
本文介绍了运行时错误“6":Visual Basic的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我使用的是 Visual Basic 6
我有以下代码结构:
FUNCNINFO 是一个结构体

I am using Visual Basic 6
I have the following code structure:
FUNCNINFO is a structure

Public funcTable() As FUNCNINFO
-----
------
ReDim Preserve funcTable(0 To upsize + ns)

当 (upsize + ns) 的值超过 32766 时,会给出运行时溢出错误 '6'您知道原因和解决方案吗?

When the value of (upsize + ns) is exceeding 32766,it is giving the runtime overflow error '6' Do you have any idea of the cause and the solution?

推荐答案

VB6 的 Integer 类型是 16 位,所以不能存储大于 32767 的值,它的 Long 是 32位整数类型,因此以下将起作用;

VB6's Integer type is 16 bits so cannot store a value > 32767, its Long that's the 32 bit integer type so the following will work;

Dim upsize As Long
Dim ns As Long

upsize = 32766
ns = 12345

ReDim Preserve funcTable(0& To upsize + ns)

这篇关于运行时错误“6":Visual Basic的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-28 00:59:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1164455.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   quot   Basic   Visual

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!