VBA Erase()函数
时 间:2019-08-03 20:39:32
作 者:杨雪 ID:42182 城市:南京
摘 要:Erase()函数用于重置固定大小数组的值并释放动态数组的内存。 它的行为取决于数组的类型。
正 文:
语法
Erase ArrayName
Erase ArrayName
固定数值数组,数组中的每个元素重置为零。
固定字符串数组,数组中的每个元素被重置为零长度 ""。
对象数组,数组中的每个元素被重置为特殊值 Nothing。
固定字符串数组,数组中的每个元素被重置为零长度 ""。
对象数组,数组中的每个元素被重置为特殊值 Nothing。
例子
添加一个模块,并添加以下代码
Private Sub Constant_demo_Click() Dim NumArray(3) NumArray(0) = "VBScript" NumArray(1) = 1.05 NumArray(2) = 25 NumArray(3) = #4/23/2013# Dim DynamicArray() ReDim DynamicArray(9) ' Allocate storage space. Erase NumArray ' Each element is reinitialized. Erase DynamicArray ' Free memory used by array. ' All values would be erased. MsgBox ("The value at Zeroth index of NumArray is " & NumArray(0)) MsgBox ("The value at First index of NumArray is " & NumArray(1)) MsgBox ("The value at Second index of NumArray is " & NumArray(2)) MsgBox ("The value at Third index of NumArray is " & NumArray(3)) End Sub
当执行上面的函数时,它会产生下面的输出。
The value at Zeroth index of NumArray is The value at First index of NumArray is The value at Second index of NumArray is The value at Third index of NumArray is
Access软件网官方交流QQ群 (群号:54525238) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- 统计当月之前(不含当月)的记录...(03.11)
- 【Access Inputbo...(03.03)
- 按回车键后光标移动到下一条记录...(02.12)
- 【Access Dsum示例】...(02.07)
- Access对子窗体的数据进行...(02.05)
- 【Access高效办公】上月累...(01.09)
- 【Access高效办公】上月累...(01.06)
- 【Access Inputbo...(12.23)
- 【Access Dsum示例】...(12.16)

学习心得
最新文章
- Access控件美化之--美化按钮...(04.19)
- Access多行文本按指定字符筛选...(04.18)
- Microsoft Access数...(04.18)
- 仓库管理实战课程(12)-月度结存...(04.16)
- 仓库管理实战课程(11)-人性化操...(04.15)
- 32位的Access软件转化为64...(04.12)
- 【Access高效办公】如何让vb...(04.11)
- 仓库管理实战课程(10)-入库功能...(04.08)
- Access快速开发平台--Fun...(04.07)
- 仓库管理实战课程(9)-开发往来单...(04.02)