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群 (群号:483923997) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- Access两种方式实现即时更...(03.01)
- Access隐藏与显示lacc...(01.12)
- 【Access高效办公】将每个...(12.23)
- Access21点游戏源代码(12.13)
- 【Access窗体导出Exce...(11.15)
- 【Access开发】Acces...(11.14)
- 通过Access宏录入数据到选...(11.10)
- 用DLOOKUP函数将需求表中...(10.31)
- Access日期区间段查询数据...(10.25)
学习心得
最新文章
- Access快速开发平台--在WI...(03.08)
- 使用SQL语句删除xscj表中学号...(03.08)
- Access快速开发平台进销存教程...(03.07)
- Access快速开发平台--frm...(03.06)
- 【Access删除查询】删除数字最...(03.06)
- Access快速开发平台进销存教程...(03.05)
- Access快速开发平台进销存教程...(03.04)
- Access快速开发平台--IsL...(03.02)
- Access两种方式实现即时更新月...(03.01)
- Access开发的资金管理系统;基...(02.29)