id loopid loopName 1 1 a 1 2 b 2 1 c 2 2 d 也就是test1(1).LoopID(1) =1 test1(1).LoopID(2) =2 ... 哪位老大知道怎么实现啊!不胜感激
Private Structure Cubicle Dim LoopID() As Integer '回路序号 Dim LoopName() As String '回路名称 end Structure private test1() as Cubicle public function getArray() as boolean redim test1(100) '初使化 ...(在这里实现) end function
[解决办法] test1(1).LoopID(1) =1 这个好像没有用到里面的loopName哦。 建议你定义成: Private Structure Cubicle Dim LoopID As Integer '回路序号 Dim LoopName As String '回路名称 end Structure
再定义一个 dim CubList as New ArrayList '用来装 Cubicle
'对 一个Cubicle 赋值 dim C as new Cubicle c.loopID=1 c.loopName=a '然后储存进 ArrayList CubList.Add(c)
对ArrayList操作起来比较方便。
'取值 x as integer y as string x=CubList(i).loopID y=CubList(i).loopName 'or c=CubList(i) x=c.loopID y=c.loopName
我不知道有没有理解错你的意思。
[解决办法]
[解决办法]
[解决办法] 你要实现把数放到test1()里面。可以参考: dim c as new cubicle c.loopID(1)=1 c.loopName(1)=a test1(1)=c c=new cubicle c.loopID(2)=2 c.loopName(2)=b test1(2)=c