在赋值前被使用。可能会在运行时导致空引用异常
为啥getmask(mask)中显示:变量“mask”在赋值前被使用。可能会在运行时导致空引用异常怎样修改谢谢!
Option Explicit On
Sub getmask(ByVal mk() As Long)
Dim i As Long
ReDim mk(0 To 30)
mk(1) = 1
For i = 2 To 30
mk(i) = mk(i - 1) * 2
Next
End Sub
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
Dim mask() As Long
Dim add As Long
add = 300
getmask(mask)
Dim sjStr(add - 1)
Dim sj(1, add - 1)
[此贴子已经被作者于2023-3-4 21:35编辑过]