|
■No57087 (みお さん) に返信
こんな感じかな
Public Structure gstructPaper
'--- 構造体の外からアクセス出来るということを分かりやすくするため
'--- Publicで宣言、以下同様
Public P_No As String
End Structure
Public Structure gstructBase
Public LotNo() As Integer
Public Data() As gstructPaper
Public Sub New(ByVal Num As Integer)
'--- どっちでもよい
ReDim LotNo(Num - 1)
Data = CType(Array.CreateInstance(GetType(gstructPaper), Num), gstructPaper())
End Sub
End Structure
Public Structure gstructLotData
Public Lot() As gstructBase
Public Sub New(ByVal Num As Integer)
Lot = CType(Array.CreateInstance(GetType(gstructBase), Num), gstructBase())
For idx = 0 To Num - 1
Lot(idx) = New gstructBase(50)
Next
End Sub
End Structure
'--- データのセット
Dim gPlanData = CType(Array.CreateInstance(GetType(gstructLotData), 2), gstructLotData())
For idx = 0 To 1
gPlanData(idx) = New gstructLotData(1000)
Next
gPlanData(i).Lot(j).Data(k).P_No="123"
|