新建From1(窗体),新建Command1(按钮CommandButton),代码:
Private Sub Command1_Click()
Dim bArr(10) As Byte
Debug.Print "值:" & bArr(4)
bArr(4) = 65
Debug.Print "赋值65后,值:" & bArr(4)
Erase bArr
Debug.Print "Erase后,值:" & bArr(4)
End Sub
运行结果:
值:0
赋值65后,值:65
Erase后,值:0
看来不用重新赋值了。