バイナリテスト.vb
Public Class Form1
Public Structure Font_0D
Dim index() As Integer
Dim col() As Integer
End Structure
Public Structure Font_F3
Dim size() As Integer
Dim name() As Integer
End Structure
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim arr1() As Integer
Dim arr2() As Integer
Dim arr3() As Integer
Dim arr4()() As Integer
Dim strcture_font_index() As Font_0D
Dim strcture_font() As Font_F3
ReDim arr1(100)
For i As Integer = 0 To arr1.Length - 1
arr1(i) = i
Next
For Each i In arr1
My.Application.Log.WriteEntry(i)
Next
My.Application.Log.WriteEntry("--最初の4つ-------------------------")
'配列の準備
ReDim arr2(3)
'配列のコピー
Array.Copy(arr1, arr2, arr2.Length)
For Each i In arr2
My.Application.Log.WriteEntry(i)
Next
My.Application.Log.WriteEntry("--単純に次をコピー------------------")
'配列の準備
ReDim arr3(arr1.Length - arr2.Length - 1)
'配列のコピー
Array.Copy(arr1, arr2.Length, arr3, 0, arr3.Length)
For Each i In arr3
My.Application.Log.WriteEntry(i)
Next
My.Application.Log.WriteEntry("--単純にジャグ配列------------------")
'配列の準備
ReDim arr4(3)
'配列のコピー
Dim srcIndex As Integer = arr2.Length
For i As Integer = 0 To arr4.Length - 1
'配列の準備
ReDim arr4(i)(7)
'配列のコピー
Array.Copy(arr1, srcIndex, arr4(i), 0, arr4(i).Length)
srcIndex = srcIndex + 7
Next
For Each arr In arr4
My.Application.Log.WriteEntry("----")
For Each arrsub In arr
My.Application.Log.WriteEntry(arrsub)
Next
Next
My.Application.Log.WriteEntry("--構造体でジャグ配列-----------------")
'配列の準備
ReDim strcture_font(3) ' ← ※3Fのサイズを読み取り配列の準備をする※
'配列のコピー
srcIndex = arr2.Length
For i As Integer = 0 To strcture_font.Length - 1
'配列の準備
ReDim strcture_font(i).size(7)
'配列のコピー
Array.Copy(arr1, srcIndex, strcture_font(i).size, 0, strcture_font(i).size.Length)
'次の場所へ移動
srcIndex = srcIndex + strcture_font(i).size.Length
'Nameのサイズ位置へ移動
srcIndex = srcIndex + 1
Dim index_next As Integer = arr1(srcIndex) / 4
'Nameのスタートへ移動
srcIndex = srcIndex + 1
'配列の準備
ReDim strcture_font(i).name(index_next)
'配列のコピー
Array.Copy(arr1, srcIndex, strcture_font(i).name, 0, strcture_font(i).name.Length)
srcIndex = srcIndex + strcture_font(i).name.Length
Next
For Each arr In strcture_font
My.Application.Log.WriteEntry("--size--" & arr.size.Length)
For Each arr_ In arr.size
My.Application.Log.WriteEntry(arr_)
Next
My.Application.Log.WriteEntry("--name--" & arr.name.Length)
For Each arr_ In arr.name
My.Application.Log.WriteEntry(arr_)
Next
Next
End Sub
End Class