定义一个字符串数据类型的二维数组 Dim Ma(1 To 12, 1 To 4) As String,1 TO 12 是行数,1 TO 4 是列数
程序代码:
Dim Ma(1 To 12, 1 To 4) As String, MC, DJ, HYJ, MBC, I As Integer, J As Integer
MC = Array("", "a", "b", "c", "d", "e", "f", "g", "h", "i", "l", "k", "t")
DJ = Array(0, 3, 2, 4, 2, 5, 8, 7, 6, 4, 3, 5, 8)
HYJ = Array(0, 2, 2, 4, 2, 5, 7, 7, 6, 3, 3, 5, 8)
MBC = Array(0, 7, 4, 5, 7, 1, 8, 1, 6, 9, 3, 3, 4)
For I = 1 To 12
Ma(I, 1) = MC(I)
Ma(I, 2) = DJ(I)
Ma(I, 3) = HYJ(I)
Ma(I, 4) = MBC(I)
Next I
Text1.Text = ""
For I = 1 To 12
For J = 1 To 4
Text1.Text = Text1.Text & Ma(I, J) & Space(4)
Next J
Text1.Text = Text1.Text & vbCrLf
Next I
下面是数组显示结果
图片附件: 游客没有浏览图片的权限,请
登录 或
注册