[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

what does the # mean in front of a line is it a comment??

Posted on 2006-11-11
4
Medium Priority
?
261 Views
Last Modified: 2010-04-23
i have a program im useing and it has # in front of the lines

the lines are pulled all the way to the left and not in structured as the others are

is this a sort of comment line and does not do anything inside to the next # line ie

# if this = that then
print to screen and move on
# end if

the lines are simmaler to the above (and i have found it does not do the instructions in the middle of the # lines too

is this the case it does not run the block??

thanks for enlightenment here
0
Comment
Question by:Johnny
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 29

Expert Comment

by:Nightman
ID: 17921069
the #If...Then...#Else directives evaluate what is compiled by the compiler and not at run time.

Conditional compilation is typically used to compile the same program for different platforms. It is also used to prevent debugging code from appearing in an executable file. Code excluded during conditional compilation is completely omitted from the final executable file, so it has no effect on size or performance.
0
 
LVL 29

Assisted Solution

by:Nightman
Nightman earned 1000 total points
ID: 17921089
You can set conditional compilation constants in one of three ways:

1. In the Property Pages dialog box of the project (see constants under the BUILD menu)
2. At the command line when using the command-line compiler
3. In your code

Have a look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vacondeclaringconditionalcompilationconstants.asp
0
 
LVL 10

Accepted Solution

by:
Kinger247 earned 1000 total points
ID: 17921097
They are compiler conditional statements.

If the if statement is true, then the code between the condition is inlcuded the build.

So, for example the below code would only include the messagebox "I'm in debug" if the current ide is set to debug.
Otherwise its set to "I'm in release"

#If DEBUG Then
  MessageBox.Show("I'm in debug")
#Else
  MessageBox.Show("I'm in release")
#End If

You can also do this on procedures etc to.
The below code would opnly allow the RunME procedure to run if the InTestMode is true. Otherwise, all calls to the procedure will not function.

Public Class Form1
  #Const InTestMode = True

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    RunME()
  End Sub

  <Conditional("InTestMode")> Public Sub RunME()
    MessageBox.Show("InTestMode")
  End Sub
End Class
0
 

Author Comment

by:Johnny
ID: 17921113
oh hey thats neet ... thanks i thought i maybe a comment as php and others do...

thanks allot
now let me think on how to award the points....
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question