Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's the "#" used for? - Newb question - sorry! :)

Status
Not open for further replies.

modfather

MIS
Feb 15, 2000
75
US
Sorry for the newb question, but what's the "#" used for as in:

#If Log Then
#End If

What's the difference between that and:

If Log Then
End If

Thanks.
Steve
 
The pound-sign (#) indicates that this is conditional compilation. The compiler will only include the code inside the #if .. #endif if the expression evaluates to true.

There's generally no need for it in .NET (although there might be a few special cases).

Most of the time it was used to do a build with extra debug code in there. But since .NET now does this automatically with the Debug object, there's no need to do that.

Chip H.
 
I've found its useful to use these directives if I'm compiling for the Compact Framework..
 
Thanks everyone. That helps a decent amount.

Merlyn2450, it's funny that you mention that because that's exactly what this project is: For the .Net CF. Why is it useful, though (forgive the ignorance. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top