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)
- Access怎么按年龄段来统计...(01.26)
- 【Access高效办公】上一年...(12.29)
- 用Access连续窗体制作的树...(11.03)
- 【Access高效办公】上一年...(10.30)
- Access制作的RGB转CM...(09.22)
- Access制作的RGB调色板...(09.15)
- Access制作的快速车牌输入...(09.13)
- 【Access高效办公】统计当...(06.30)
- 【Access高效办公】用复选...(06.24)
学习心得
最新文章
- Access快速开发平台--自动创...(02.09)
- Access快速开发平台--错误号...(02.02)
- Access怎么按年龄段来统计人数...(01.26)
- 【Access更新查询示例】怎么把...(01.19)
- Access快速开发平台--错误号...(01.13)
- Access快速开发平台--错误号...(01.04)
- 【Access高效办公】上一年度累...(12.29)
- Access快速开发平台--2.6...(12.24)
- Access快速开发平台企业版--...(12.10)
- SqlServer默认当前时间用什...(11.28)


.gif)
