这个程序哪里错了?为什么总是提示说下标越界?

来源:百度知道 编辑:UC知道 时间:2024/07/02 09:36:35
Dim y() As Integer
Dim mm() As Integer
Dim ii As Integer
Dim jj As Integer

For ii = 0 To a - 1
ReDim y(ii) As Integer
ReDim mm(ii) As Integer
For jj = 0 To a - 1 - NUM
Picture2.CurrentX = 150 + 300 * ii
mm(ii) = InStr(Text2.Text, ii)
If mm(ii) = 0 Then
y(ii) = 300 * 5 - 150 - 300 * jj
Else
Dim QQ() As Integer
ReDim QQ(ii) As Integer
QQ(ii) = Mid(Text1.Text, mm(ii), 1)
Dim ff As Integer
ff = Val(QQ(ii))
y(ii) = y(ff)
End If
Picture2.CurrentY = Val(y(ii))
Picture2.Print "×"

Next jj

VB 程序啊
没有注释啊,不太清楚你实现什么功能……
ReDim y(ii) As Integer
ReDim mm(ii) As Integer 重定义数组,用的着用个FOR 循环么?
还有你那个a —1的a有定义么
再看看吧,帮不上什么了