A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/directives/disable-enable below:

Enable and Disable directives - Visual Basic

#Disable and #Enable directives (Visual Basic)

In this article

The #Disable and #Enable directives are Visual Basic source code compiler directives. They are used to disable and re-enable all or specific warnings for regions of code.

    Dim variable1    'warning BC42024: Unused local variable: 'variable1'.
#Disable Warning
    Dim variable2    'no warning
#Enable Warning
    Dim variable3    'warning BC42024: Unused local variable: 'variable3'.
' Suppress warning about no awaits in this method.
#Disable Warning BC42356
    Async Function TestAsync() As Task
        Console.WriteLine("testing")
    End Function
#Enable Warning BC42356

You can also disable and enable a comma-separated list of warning codes.

See also

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.

Additional resources

In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4