创建数据对象的数组的数组? [英] Creating an array of arrays of data objects?

查看:89
本文介绍了创建数据对象的数组的数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据对象。

我也有这些数据对象的数组

I also have arrays of these data objects

我希望把数据对象的这些阵列到另一个阵列

I want to put these arrays of data objects into another array

Dim ArrayOfDataObjects1(10) as new DataObject
Dim ArrayOfDataObjects2(10) as new DataObject
Dim ArrayOfDataObjects3(10) as new DataObject

'Now, I want to put all of these into another array, how can I?

谢谢!

编辑:我知道我需要创建一个大小3另一个数组,但什么类型的我定义数组为

edit: I know I need to create another array with size 3, but what type do I define the array as?

推荐答案

如果你不使用类型安全而言,你可以使用的变种。例如,在Excel中VBA:

If you are not concerned with type-safety, you could use Variant. Example in Excel VBA:

Sub a()
Dim ArrayOfDataObjects1(10) As Worksheet
Dim ArrayOfDataObjects2(10) As Worksheet
Dim ArrayOfDataObjects3(10) As Worksheet

Dim arr(3) As Variant

Set ArrayOfDataObjects1(1) = ActiveSheet

arr(1) = ArrayOfDataObjects1

arr(2) = ArrayOfDataObjects2

arr(3) = ArrayOfDataObjects3

MsgBox arr(1)(1).Name

End Sub

这篇关于创建数据对象的数组的数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆