【发布时间】:2017-06-07 12:32:50
【问题描述】:
我的代码遇到了问题,如下:
Option Explicit Off
Option Strict On 'Results in Compiler Error. Expected base or compare or explicit or private
Sub DoSomething()
Dim intOne As Integer 'This line works
intOne = 1 'This line works
Dim intTwo as Integer = 2 'Results in Compiler Error: Expected end of statement
End Sub
我的问题在上面的代码中写成 cmets。
即使模块完全为空,我也无法启用Option Strict 选项。
我认为解决方案在 Visual Studio 的选项中。
注意:我已经手动翻译了德语的错误信息,所以请期待上述和官方英文版本之间的差异。
【问题讨论】:
标签: vb.net visual-studio compiler-errors option-strict option-explicit