作者s963870 (flare0118)
看板Visual_Basic
标题[VBA ] Array宣告问题
时间Tue May 31 22:47:59 2011
Sub SwapBlank(BtnNo As Variant)
Dim i As Integer
Dim Neighbors
Neighbors = Array(Array("2","4"),_
Array("1","3","5"),_
Array("2","6"),_
Array("1","5","7"),_
Array("2","4","6","8"),_
Array("3","5","9"),_
Array("4","8"),_
Array("5","7","9"),_
Array("6","8"))
If Controls("CommandButton"& BtnNo).Caption<>""Then
For i = 1 To UBound(Neibors(BtnNo))
If Controls("CommandButton"&Neighbors(BtnNo)(i)).Caption = "" Then
Controls("CommandButton"&Neighbors(BtnNo)(i)).Caption =
Controls("CommandButton"&BtnNo).Caption)
Controls("CommandButton"&BtnNo).Caption = ""
Exit For
End If
Next i
End If
End Sub
可以请问这样ARRAY宣告部分有错误吗? 错的话应该怎麽订正??
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 125.233.146.192
※ s963870:转录至看板 Programming 05/31 22:51
1F:→ MOONRAKER:底线前面要有空格。 06/01 00:37
2F:→ s963870:感谢楼上 宣告成功了 06/01 08:35