本文介绍了如何在vb6中声明用户定义类型的数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Type ABFator
a As Single
b As Sinlge
End Type
Dim ABFactorArr(8) As ABFactor
'基本上,我想声明一个包含八个ABFactor的数组,然后可以访问
'Basically I want to declare an array of eight ABFactors which I can then access
我这样做了,编译器给出了错误的用户定义类型,未定义
I do this and the complier gives error user defined type not defined
谢谢
推荐答案
拼写错误?缺少C吗?
Spelling mistake? Missing c?
- 您已将类型定义为
ABFator
,没有c - ,并且已将数组作为
ABFactor
并带有c
- You've defined the type as
ABFator
with no c - and you've put the array as
ABFactor
with a c
您在类型定义中也输入了错误的Single
You've also mistyped Single
in your Type definition
或者,如果您要在一个模块中定义它并在另一个模块中使用它,也许您需要创建Public
类型?
Alternatively perhaps you need to make the Type Public
, in case you are defining it in one module and using it in another?
(以后,请将代码复制并粘贴到您的问题中,因为您在问题中用三种不同的方式拼写了ABFactor!)
(Please copy and paste the code into your questions in future, as you've spelt ABFactor three different ways in your question!)
这篇关于如何在vb6中声明用户定义类型的数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!