维数组的结构 Dim StrA(8)As Integer StA(O 线性顺序 SUA() StrA(O) StA( StrA(1) 逻辑结构 tr StrA(2) StrA(3) StrA() StrA(4) 存储结构SA(5) StrA(5) StTA(6) StrA(6) StrA(T StrA(7) StA( StrA(8
一维数组的结构 Dim StrA(8) As Integer 线性顺序 StrA(0) StrA(1) StrA(2) StrA(3) StrA(4) StrA(5) StrA(6) StrA(7) StrA(8) StrA(8) StrA(7) StrA(6) StrA(5) StrA(4) StrA(3) StrA(2) StrA(1) StrA(0) 存储结构 逻辑结构 存储结构
维数组的结构 Table (1,1) Option base 1 Table(2, 1) Dim Table(3, 4)As Integer Table (3, 1) Table(1, 2) 按列存放 Table2, 2) Table(3, 2 Table(1, 1) Table(1, 2) Table(1, 3) Table(1, 4) Table(1, 3) Table2, 3) Table(2, 1) Table(2, 2) Table(2, 3) Table(2, 4) Table (3, 3) Table(3, 1) Table(3,2) Table(3, 3) Table(3,4) able(1, 4) Table (2, 4) Table(3, 4) 逻辑结构 存储结构
二维数组的结构 • Option Base 1 Dim Table(3,4) As Integer 按列存放 Table(1,1) Table(2,1) Table(3,1) Table(1,2) Table(2,2) Table(3,2) Table(1,3) Table(2,3) Table(3,3) Table(1,4) Table(2,4) Table(3,4) Table(3,1) Table(2,1) Table(3,2) Table(3,3) Table(3,4) Table(2,2) Table(2,3) Table(2,4) Table(1,1) Table(1,2) Table(1,3) Table(1,4) 存储结构 逻辑结构 存储结构
维数组的结构 Dim Page (3, 3, 2) AS Integer Page(1,1,1) Page(2,1,1) (行,列,页) Page(3,1,1) Page(1,2,1) 存放:逐页逐列(先变左边下标) 221 Page(1,12)Page(1,2,2)Page(1,3,2) Page(1,1,2) (2,3,2) Page(2,1,2) Page(1,1,1)Page(1,2,1)Page(1,3,1) Page(2,.1)Pag(2,2,1)Page(231/(3,32) Page(3,1,2) Page(132,2 Page(3,11)Page(3,2,1)Page(3,3,1) Page(3,3,2) 逻辑结构 存储结构
三维数组的结构 Page(3,1,1) Page(2,1,1) Page(1,1,2) Page(3,2,1) Page(2,2,1) Page(1,2,2) Page(3,3,2) Page(2,3,2) Page(1,3,2) Page(3,1,1) Page(2,1,1) Page(1,1,1) Page(3,2,1) Page(2,2,1) Page(1,2,1) Page(3,3,1) Page(2,3,1) Page(1,3,1) 逻辑结构 存储结构 Page(1,1,1) Page(2,1,1) Page(3,1,1) Page(1,2,1) … Page(3,3,1) Page(1,1,2) Page(2,1,2) Page(3,1,2) Page(1,2,2) … Page(3,3,2) Dim Page(3,3,2) AS Integer (行,列,页) 存放:逐页逐列(先变左边下标) 逻辑结构 存储结构
数组函数及数组语句514 LBound函数与 UBound函数 Erase语句 For each…Next结构语句
数组函数及数组语句 • LBound 函数 与UBound 函数 • Erase 语句 • For Each … Next结构语句 5.1.4
LBound函数; UBound函数 Lbound的功能: 是返回数组某维的维下界的值(例) Ubound的功能: 是返回数组某维的维上界的值(例) 例如:dima(2to3,0to5 print Lbound(a), lbound(a, 2) print Ubound(a), Ubound(a, 2)
LBound 函数; UBound 函数 Lbound的功能: 是返回数组某维的维下界的值(例) Ubound的功能: 是返回数组某维的维上界的值(例) 例如:dim a(-2 to 3,0 to 5) ……... print Lbound(a),Lbound(a,2) print Ubound(a),Ubound(a,2) ………