vb中如何把一个二维数组赋给另外一个二维数组
展开全部
Dim a(10,20),b(10,20)
'对数组a赋值
for i=0 to 10
for j=0 to 20
b(i,j)=a(i,j)
next
next
'对数组a赋值
for i=0 to 10
for j=0 to 20
b(i,j)=a(i,j)
next
next
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim i, j, m, n As Integer
Dim a(7, 8), b(7, 8) As Integer
i = 0
j = 0
Print "给第一个数组赋初始值"
For i = 0 To 6
For j = 0 To 7
a(i, j) = i + j
If j = 7 Then
Print "a[" & i; "," & j & "]="; a(i, j) & vbCrLf
Else
Print "a[" & i; "," & j & "]="; a(i, j);
End If
Next j
Next i
Print "把第一个数组的值,给第二个数组"
For i = 0 To 6
For j = 0 To 7
b(i, j) = a(i, j)
If j = 7 Then
Print "b[" & i; "," & j & "]="; a(i, j) & vbCrLf
Else
Print "b[" & i; "," & j & "]="; a(i, j);
End If
Next j
Next i
End Sub
Dim i, j, m, n As Integer
Dim a(7, 8), b(7, 8) As Integer
i = 0
j = 0
Print "给第一个数组赋初始值"
For i = 0 To 6
For j = 0 To 7
a(i, j) = i + j
If j = 7 Then
Print "a[" & i; "," & j & "]="; a(i, j) & vbCrLf
Else
Print "a[" & i; "," & j & "]="; a(i, j);
End If
Next j
Next i
Print "把第一个数组的值,给第二个数组"
For i = 0 To 6
For j = 0 To 7
b(i, j) = a(i, j)
If j = 7 Then
Print "b[" & i; "," & j & "]="; a(i, j) & vbCrLf
Else
Print "b[" & i; "," & j & "]="; a(i, j);
End If
Next j
Next i
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2011-09-14
展开全部
源数组为a(假设为long型),目标数组为b:
Dim b() As Long 'b定义为动态数组
b = a
Dim b() As Long 'b定义为动态数组
b = a
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<script language="vbscript">
dim a,b
a=Array(1,2,3)
b=a
document.write(b(0))
</script>
dim a,b
a=Array(1,2,3)
b=a
document.write(b(0))
</script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询