What do Option Strict and Option Explicit do?

前端 未结 3 1152
天命终不由人
天命终不由人 2020-11-21 07:37

I saw this post:

Typos… Just use option strict and explicit please.. during one software development project, which I was on as a consultant, they w

3条回答
  •  天涯浪人
    2020-11-21 08:22

    Find details here: http://support.microsoft.com/kb/311329

    The Option Explicit statement

    By default, the Visual Basic .NET or Visual Basic compiler enforces explicit variable declaration, which requires that you declare every variable before you use it. To change this default behavior, see the Change the Default Project Values section.

    The Option Strict statement

    By default, the Visual Basic .NET or Visual Basic compiler does not enforce strict data typing. To change this default behavior, see the Change the Default Project Values section.

提交回复
热议问题