首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

vb type 内嵌动态数组的有关问题

2012-01-23 
vb type 内嵌动态数组的问题Typeaabb()AsIntegerEndTypeDimccAsaaReDimbb(10)AsIntegerPrintcc.bb(2)请问

vb type 内嵌动态数组的问题
Type   aa
  bb()   As   Integer
End   Type

Dim   cc   As   aa
ReDim   bb(10)   As   Integer
Print   cc.bb(2)

请问最后一行为什么会报错:下标越界?

[解决办法]
打快了 有个错误
Type aa
bb() As Integer
End Type

Dim cc As aa
ReDim cc.bb(10) '这里不用再指明变量类型
Print cc.bb(2)

热点排行