VB 初始化超过一行的数组

VB initialise an array over more than one line

我是 C 程序员,必须做一些 VB。我需要初始化一个数组,它不会编译。 这有什么问题,

   Dim array() As Integer = {
        &H0, &H80, &H2, &H2, &H33, &H0, &H0, &H1A, &H53, &H79, &H51, &H75, &H65, &H73, &H74, &H20
        ,&H53, &H79, &H4A, &H65, &H74, &H2D, &H53, &H20, &H20, &H20, &H20, &H20, &H20, &H20, &H20, &H20
        ,&H30, &H31, &H31, &H31}

所有正确的字符都以正确的顺序排列。 我假设它是行首的逗号。 VB 标准中是否有某些内容使此非法?

在VB中,您需要在行尾使用续行符_,或者将换行符放在逗号之后而不是之前。

Dim array() As Integer = {
    &H0, &H80, &H2, &H2, &H33, &H0, &H0, &H1A, &H53, &H79, &H51, &H75, &H65, &H73, &H74, &H20,
    &H53, &H79, &H4A, &H65, &H74, &H2D, &H53, &H20, &H20, &H20, &H20, &H20, &H20, &H20, &H20, &H20 _
    , &H30, &H31, &H31, &H31}

如我之前的评论所述:

Dim array() As Integer = {
    &H0, &H80, &H2, &H2, &H33, &H0, &H0, &H1A, &H53, &H79, &H51, &H75, &H65, &H73, &H74, &H20 _
    , &H53, &H79, &H4A, &H65, &H74, &H2D, &H53, &H20, &H20, &H20, &H20, &H20, &H20, &H20, &H20, &H20 _
    , &H30, &H31, &H31, &H31}