tags:

views:

1060

answers:

2

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
        'Something Else
    #End If

I am pretty sure the PRE611 has something to do with versioning, but I would like to know what specifically the # sign does.

+9  A: 

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

dr. evil
Thanks for the link. It is kind of difficult to search for a # sign.
Jim
A: 

It's a pre-processor directive.

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

George Stocker