Hash sign (#) in VB.NET

前端 未结 2 947
孤城傲影
孤城傲影 2021-01-15 09:12

I have this legacy code that I am working with and there is code like this all over the place:

    #If PRE611 = True Then
        \'Do Something
    #Else
                


        
相关标签:
2条回答
  • 2021-01-15 09:42

    Those are directives, and allows you to do conditional compiling. # sign used for directives.

    In this case It will compiled either part of the code based on the evaluation of "PRE611 = True"

    You can see this article for some examples : http://visualbasic.about.com/od/usingvbnet/a/vbdirectives01_2.htm

    0 讨论(0)
  • 2021-01-15 09:50

    It's a pre-processor directive.

    It essentially means if PRE611 is defined as true (in the pre-processor) to compile whatever follows.

    0 讨论(0)
提交回复
热议问题