Private Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As Any, pSource As Any, ByVal ByteLen As Long)Private Sub Command1_Click() Dim a(2, 2) As Integer Dim b(8) As Integer
Dim i As Integer Dim j As Integer For i = 0 To 2 For j = 0 To 2 a(i, j) = i * 2 + j Next j, i
MoveMemory b(0), a(0, 0), 9 For i = 0 To 8 Debug.Print b(i) Next i
Option Explicit Private Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As Any, pSource As Any, ByVal ByteLen As Long) Private Sub Command1_Click() Dim a(6, 6) As Integer Dim b(6) As Integer
Dim i As Integer Dim j As Integer For i = 0 To 6 For j = 0 To 6 a(i, j) = j Next j, i
MoveMemory b(0), a(0,4), 7 * 2 '注意它是把第4行 全部传过去了,这给数组的存储顺序相关,你可以变通一下,可以取行的数据么。 For i = 0 To 6 Debug.Print b(i) Next i
Dim a(2, 2) As Integer
Dim b(8) As Integer
Dim i As Integer
Dim j As Integer
For i = 0 To 2
For j = 0 To 2
a(i, j) = i * 2 + j
Next j, i
MoveMemory b(0), a(0, 0), 9
For i = 0 To 8
Debug.Print b(i)
Next i
End Sub
Private Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As Any, pSource As Any, ByVal ByteLen As Long)
Private Sub Command1_Click()
Dim a(6, 6) As Integer
Dim b(6) As Integer
Dim i As Integer
Dim j As Integer
For i = 0 To 6
For j = 0 To 6
a(i, j) = j
Next j, i
MoveMemory b(0), a(0,4), 7 * 2 '注意它是把第4行 全部传过去了,这给数组的存储顺序相关,你可以变通一下,可以取行的数据么。
For i = 0 To 6
Debug.Print b(i)
Next i
End Sub
http://expert.csdn.net/Expert/topic/1769/1769380.xml?temp=.8412744
可以用movememory,这时估计要去掉文件头数据