无法用非数组类型“<elementname>”初始化变量

声明为数组的变量必须使用数组值进行初始化。

' Not valid.  
' The following line causes this error when executed with Option Strict off.  
' Dim arrayVar1() = 10  

错误 ID: BC36536

更正此错误

  • 使用数组值初始化数组变量:

    ' With Option Strict off.  
    Dim arrayVar2() = {1, 2, 3}  
    ' With Option Strict on.  
    Dim arrayVar3() As Integer = {1, 2, 3}