我自定义类型: Type myData
t as string
i as integer
end type sub test()
dim d as myData
dim c as new collection
c.add d
end sub
执行以上test()过程将提示出错,或者将自定义类型当参数传递也出现同样的错误提示,如下:
Type myData
t as string
i as integer
end type sub test()
dim d as myData
call test1(d)
end sub
sub test1(tt as myData)
...
end sub 请问VB6能否传递自定义类型,如果能,如何传递?
t as string
i as integer
end type sub test()
dim d as myData
dim c as new collection
c.add d
end sub
执行以上test()过程将提示出错,或者将自定义类型当参数传递也出现同样的错误提示,如下:
Type myData
t as string
i as integer
end type sub test()
dim d as myData
call test1(d)
end sub
sub test1(tt as myData)
...
end sub 请问VB6能否传递自定义类型,如果能,如何传递?
解决方案 »
- 请教各位大哥匹配字符串的问题!!!
- 菜鸟的问题
- (高分)谁知道怎么实现邮件的群发功能?一定给!!!!!!!!!!!!
- 想自己制作一个combobox遇到的问题
- 进程
- 在线等待:怎么为datagrid控件的某一格赋值?
- 高分求解:资源里的自定义资源保存问题?
- 显示的却是一连串字母,请问高手怎么解决!急!!!在线等,谢谢!!!!
- 谁有繁体版或者英文版的VB6.0企业版可以发给我一份,或者告诉我地址我去下载,重谢!
- 想写一个兼容winpopup和Message server的程序,不知该看些什么资料?或者谁能给我讲讲原理!如发送的消息格式是如何的,使用什么端口等...
- 非高手不能解:如何使用VB写拦截textout函数的代码?
- 如何控制某个网页里面的iframe里面的表单自动提交 在线
如果不是放在标准模块中,声明改为这样: Private Type myData
t as string
i as integer
end type sub test()
dim d as myData
call test1(d)
end sub
Private sub test1(tt as myData)
...
end sub
t as string
i as integer
end type sub test()
dim d as myData
dim c as new collection
c.add d
end sub
------------------------------------------------
上面的往集合里添加成员的代码有错误,不能往集合添加结构体类型数据:dim d as myData
dim c as new collectionc.add d '错误写法
c.add d.t '正确写法
c.add d.i '正确写法
必须指定自定义类型中的某一个变量,而且必须注意数据类型.