分享:
▲
在 VB.NET 里的 Structure 并没有办法使用 Initialize() 来初始设定, 若一定要使用类似 Initialize的方式,请宣告成类别。
使用Structure则可以如下面的方式初始阵列: Public Const c1 = 255 Public Const c2 = 255 Public Const c3 = 15
Structure ppp 记得将 dim 改public public X As Integer End Structure
Structure hhh public Point() As ppp End Structure
Structure sta Public Home() As hhh End Structure
Public Sub InitRegData() 初始化阵列大小 dim sss(c1) as sta for i as integer=0 to c1 redim sss(i).Home(c2) for j as integer=0 to c2 redim sss(i).Home(j).Point(c3) next next 初始化阵列大小完成 下面再接你要处理、执行的程式码…… …… ……
End Sub
|